Ejemplo n.º 1
0
def test_Image_open_image(images_path_tar):
    images = Images()
    images.read(images_path_tar / 'test.build.json')
    image = images['test']

    with image.open_image('qcow2') as f:
        assert f.read(8) == b'QFI\xfb\0\0\0\3'

    with image.open_image('vhd') as f:
        assert f.read(8) == b'1' * 8
        f.seek(-512, os.SEEK_END)
        assert f.read(16) == b'conectix\0\0\0\2\0\1\0\0'

    with image.open_image('vmdk') as f:
        assert f.read(8) == b'KDMV\3\0\0\0'
Ejemplo n.º 2
0
def test_Images(images_path):
    images = Images()
    images.read(images_path / 'test.build.json')
    images.read(images_path / 'test.upload.json')
    assert len(images) == 1
Ejemplo n.º 3
0
def test_Image_open_tar_xz(images_path_tar_xz):
    images = Images()
    images.read(images_path_tar_xz / 'test.build.json')
    image = images['test']
    with image.open_tar() as f:
        assert f