def test_single_with_delete(): """ Single Drive without Delete on Termination """ user_input = "/dev/xvda=:100:false:" mapping = _parse_block_device_mappings(user_input) first_device = mapping['/dev/xvda'] first_device.ephemeral_name.should.be.none first_device.snapshot_id.should.be.none first_device.iops.should.none first_device.volume_type.should.equal('standard') first_device.size.should.equal(100) first_device.delete_on_termination.should.be.false
def test_single_with_iops(): """ Single Drive with IOPS """ user_input = "/dev/xvda=:100::1000" mapping = _parse_block_device_mappings(user_input) first_device = mapping['/dev/xvda'] first_device.ephemeral_name.should.be.none first_device.snapshot_id.should.be.none first_device.iops.should.equal(1000) first_device.volume_type.should.equal('io1') first_device.size.should.equal(100) first_device.delete_on_termination.should.be.true
def test_single_ebs_input(): """ Single EBS Drive """ user_input = "/dev/xvda=:100" mapping = _parse_block_device_mappings(user_input) first_device = mapping['/dev/xvda'] first_device.ephemeral_name.should.be.none first_device.snapshot_id.should.be.none first_device.iops.should.be.none first_device.volume_type.should.equal('standard') first_device.size.should.equal(100) first_device.delete_on_termination.should.be.true
def test_multiple_snapshot_input(): """ Multiple Snapshot Drives """ user_input = "/dev/xvda=snap-1234abcd,/dev/xvdb=snap-abcd1234" mapping = _parse_block_device_mappings(user_input) first_device = mapping['/dev/xvda'] first_device.snapshot_id.should.equal('snap-1234abcd') first_device.ephemeral_name.should.be.none first_device.iops.should.be.none first_device.volume_type.should.equal('standard') first_device.size.should.be.none first_device.delete_on_termination.should.be.true second_device = mapping['/dev/xvdb'] second_device.snapshot_id.should.equal('snap-abcd1234') second_device.ephemeral_name.should.be.none second_device.iops.should.be.none second_device.volume_type.should.equal('standard') second_device.size.should.be.none second_device.delete_on_termination.should.be.true
def test_multiple_ephemeral_input(): """ Multiple Ephemeral Drives """ user_input = "/dev/xvda=ephemeral0,/dev/xvdb=ephemeral1" mapping = _parse_block_device_mappings(user_input) first_device = mapping['/dev/xvda'] first_device.ephemeral_name.should.equal('ephemeral0') first_device.snapshot_id.should.be.none first_device.iops.should.be.none first_device.volume_type.should.be.none first_device.size.should.be.none first_device.delete_on_termination.should.be.true second_device = mapping['/dev/xvdb'] second_device.ephemeral_name.should.equal('ephemeral1') second_device.snapshot_id.should.be.none second_device.iops.should.be.none second_device.volume_type.should.be.none second_device.size.should.be.none second_device.delete_on_termination.should.be.true