Skip to content

Commit

Permalink
Add tests (and correct existing test)
Browse files Browse the repository at this point in the history
  • Loading branch information
robsyme committed Jul 26, 2024
1 parent 8beef54 commit 316bd84
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,25 @@ class AwsContainerOptionsMapperTest extends Specification {
def map = CmdLineHelper.parseGnuArgs('--shm-size 12048024')
def properties = AwsContainerOptionsMapper.createContainerProperties(map)
then:
properties.getLinuxParameters().getSharedMemorySize() == 12048024
properties.getLinuxParameters().getSharedMemorySize() == 11
}

def 'should set shared memory size with unit in MiB'() {

when:
def map = CmdLineHelper.parseGnuArgs('--shm-size 256m')
def properties = AwsContainerOptionsMapper.createContainerProperties(map)
then:
properties.getLinuxParameters().getSharedMemorySize() == 256
}

def 'should set shared memory size with unit in GiB'() {

when:
def map = CmdLineHelper.parseGnuArgs('--shm-size 1g')
def properties = AwsContainerOptionsMapper.createContainerProperties(map)
then:
properties.getLinuxParameters().getSharedMemorySize() == 1024
}

def 'should set memory swappiness'() {
Expand Down

0 comments on commit 316bd84

Please sign in to comment.