Skip to content
Snippets Groups Projects
Commit 55b11630 authored by Vladimir Sementsov-Ogievskiy's avatar Vladimir Sementsov-Ogievskiy Committed by Kevin Wolf
Browse files

iotests.py: add unarchive_sample_image() helper


Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210224104707.88430-6-vsementsov@virtuozzo.com>
Reviewed-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent baefd977
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#
import atexit
import bz2
from collections import OrderedDict
import faulthandler
import io
......@@ -24,6 +25,7 @@
import logging
import os
import re
import shutil
import signal
import struct
import subprocess
......@@ -96,6 +98,14 @@
os.environ.get('IMGKEYSECRET', '')
luks_default_key_secret_opt = 'key-secret=keysec0'
sample_img_dir = os.environ['SAMPLE_IMG_DIR']
def unarchive_sample_image(sample, fname):
sample_fname = os.path.join(sample_img_dir, sample + '.bz2')
with bz2.open(sample_fname) as f_in, open(fname, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
def qemu_tool_pipe_and_status(tool: str, args: Sequence[str],
connect_stderr: bool = True) -> Tuple[str, int]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment