Commit e53fe706 authored by Milan Broz's avatar Milan Broz

Use only xz archives in tests.

Bzip2 is sometimesmissing and we use xz already.

Seems xz produces slightly larger archives (despite the best mode)
but it is not worth to keep bz2 here.
parent 9e2e0a4a
......@@ -30,22 +30,22 @@ if INTEGRITYSETUP
TESTS += integrity-compat-test
endif
EXTRA_DIST = compatimage.img.bz2 compatv10image.img.bz2 \
EXTRA_DIST = compatimage.img.xz compatv10image.img.xz \
compatimage2.img.xz \
conversion_imgs.tar.xz \
luks2_keyslot_unassigned.img.xz \
img_fs_ext4.img.bz2 img_fs_vfat.img.bz2 img_fs_xfs.img.bz2 \
valid_header_file.bz2 \
img_fs_ext4.img.xz img_fs_vfat.img.xz img_fs_xfs.img.xz \
valid_header_file.xz \
luks2_valid_hdr.img.xz \
luks2_header_requirements.xz \
luks2_header_requirements_free.xz \
evil_hdr-payload_overwrite.bz2 \
evil_hdr-stripes_payload_dmg.bz2 \
evil_hdr-luks_hdr_damage.bz2 \
evil_hdr-small_luks_device.bz2 \
evil_hdr-keyslot_overlap.bz2 \
tcrypt-images.tar.bz2 \
luks1-images.tar.bz2 \
evil_hdr-payload_overwrite.xz \
evil_hdr-stripes_payload_dmg.xz \
evil_hdr-luks_hdr_damage.xz \
evil_hdr-small_luks_device.xz \
evil_hdr-keyslot_overlap.xz \
tcrypt-images.tar.xz \
luks1-images.tar.xz \
compat-test \
compat-test2 \
loopaes-test align-test discards-test mode-test password-hash-test \
......@@ -101,7 +101,7 @@ conversion_imgs:
@tar xJf conversion_imgs.tar.xz
compatimage.img:
@bzip2 -k -d compatimage.img.bz2
@xz -k -d compatimage.img.xz
valgrind-check: api-test api-test-2 differ
@VALG=1 ./compat-test
......
......@@ -227,9 +227,9 @@ echo "# Create enterprise-class 4K drive with fs and LUKS images."
# loop device here presents 512 block but images have 4k block
# cryptsetup should properly use 4k block on direct-io
add_device dev_size_mb=32 sector_size=4096 physblk_exp=0 num_tgts=1 opt_blks=64
for file in $(ls img_fs_*.img.bz2) ; do
for file in $(ls img_fs_*.img.xz) ; do
echo "Format using fs image $file."
bzip2 -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
mount $DEV $MNT_DIR || skip "Mounting image is not available."
echo $PWD1 | $CRYPTSETUP luksFormat --type luks1 -i 1 $MNT_DIR/luks.img || fail
......
......@@ -255,7 +255,7 @@ static int _setup(void)
_system("dmsetup create " DEVICE_EMPTY_name " --table \"0 10000 zero\"", 1);
_system("dmsetup create " DEVICE_ERROR_name " --table \"0 10000 error\"", 1);
_system(" [ ! -e " IMAGE1 " ] && bzip2 -dk " IMAGE1 ".bz2", 1);
_system(" [ ! -e " IMAGE1 " ] && xz -dk " IMAGE1 ".xz", 1);
fd = loop_attach(&DEVICE_1, IMAGE1, 0, 0, &ro);
close(fd);
......@@ -264,22 +264,22 @@ static int _setup(void)
close(fd);
/* Keymaterial offset is less than 8 sectors */
_system(" [ ! -e " EVL_HEADER_1 " ] && bzip2 -dk " EVL_HEADER_1 ".bz2", 1);
_system(" [ ! -e " EVL_HEADER_1 " ] && xz -dk " EVL_HEADER_1 ".xz", 1);
/* keymaterial offset aims into payload area */
_system(" [ ! -e " EVL_HEADER_2 " ] && bzip2 -dk " EVL_HEADER_2 ".bz2", 1);
_system(" [ ! -e " EVL_HEADER_2 " ] && xz -dk " EVL_HEADER_2 ".xz", 1);
/* keymaterial offset is valid, number of stripes causes payload area to be overwritten */
_system(" [ ! -e " EVL_HEADER_3 " ] && bzip2 -dk " EVL_HEADER_3 ".bz2", 1);
_system(" [ ! -e " EVL_HEADER_3 " ] && xz -dk " EVL_HEADER_3 ".xz", 1);
/* luks device header for data and header on same device. payloadOffset is greater than
* device size (crypt_load() test) */
_system(" [ ! -e " EVL_HEADER_4 " ] && bzip2 -dk " EVL_HEADER_4 ".bz2", 1);
_system(" [ ! -e " EVL_HEADER_4 " ] && xz -dk " EVL_HEADER_4 ".xz", 1);
/* two keyslots with same offset (overlapping keyslots) */
_system(" [ ! -e " EVL_HEADER_5 " ] && bzip2 -dk " EVL_HEADER_5 ".bz2", 1);
_system(" [ ! -e " EVL_HEADER_5 " ] && xz -dk " EVL_HEADER_5 ".xz", 1);
/* valid header: payloadOffset=4096, key_size=32,
* volume_key = bb21158c733229347bd4e681891e213d94c685be6a5b84818afe7a78a6de7a1a */
_system(" [ ! -e " VALID_HEADER " ] && bzip2 -dk " VALID_HEADER ".bz2", 1);
_system(" [ ! -e " VALID_HEADER " ] && xz -dk " VALID_HEADER ".xz", 1);
/* Prepare tcrypt images */
_system(" [ ! -d tcrypt-images ] && tar xjf tcrypt-images.tar.bz2 2>/dev/null", 1);
_system(" [ ! -d tcrypt-images ] && tar xjf tcrypt-images.tar.xz 2>/dev/null", 1);
_system("modprobe dm-crypt", 0);
_system("modprobe dm-verity", 0);
......
......@@ -69,9 +69,9 @@ falloc() {
}
run_all_in_fs() {
for file in $(ls img_fs_*.img.bz2) ; do
for file in $(ls img_fs_*.img.xz) ; do
echo "Run tests in $file put on top block device."
bzip2 -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
xz -d -c $file | dd of=$DEV bs=1M 2>/dev/null || fail "bad image"
[ ! -d $MNT_DIR ] && mkdir $MNT_DIR
mount $DEV $MNT_DIR || skip "Mounting image $file failed."
rm -rf $MNT_DIR/* 2>/dev/null
......
......@@ -104,19 +104,19 @@ function prepare()
;;
new)
remove_mapping
bzip2 -cd compatimage.img.bz2 > $IMG
xz -cd compatimage.img.xz > $IMG
# FIXME: switch to internal loop (no losetup at all)
echo "bad" | $CRYPTSETUP luksOpen --key-slot 0 --test-passphrase $IMG 2>&1 | \
grep "autoclear flag" && skip "WARNING: Too old kernel, test skipped."
losetup $LOOPDEV $IMG
bzip2 -cd compatv10image.img.bz2 > $IMG10
xz -cd compatv10image.img.xz > $IMG10
;;
reuse | *)
if [ ! -e $IMG ]; then
bzip2 -cd compatimage.img.bz2 > $IMG
xz -cd compatimage.img.xz > $IMG
losetup $LOOPDEV $IMG
fi
[ ! -e $IMG10 ] && bzip2 -cd compatv10image.img.bz2 > $IMG10
[ ! -e $IMG10 ] && xz -cd compatv10image.img.xz > $IMG10
;;
esac
......
......@@ -99,20 +99,20 @@ function prepare()
;;
new)
remove_mapping
bzip2 -cd compatimage.img.bz2 > $IMG
xz -cd compatimage.img.xz > $IMG
xz -dk $HEADER_KEYU.xz
# FIXME: switch to internal loop (no losetup at all)
echo "bad" | $CRYPTSETUP luksOpen --key-slot 0 --test-passphrase $IMG 2>&1 | \
grep "autoclear flag" && skip "WARNING: Too old kernel, test skipped."
losetup $LOOPDEV $IMG
bzip2 -cd compatv10image.img.bz2 > $IMG10
xz -cd compatv10image.img.xz > $IMG10
;;
reuse | *)
if [ ! -e $IMG ]; then
bzip2 -cd compatimage.img.bz2 > $IMG
xz -cd compatimage.img.xz > $IMG
losetup $LOOPDEV $IMG
fi
[ ! -e $IMG10 ] && bzip2 -cd compatv10image.img.bz2 > $IMG10
[ ! -e $IMG10 ] && xz -cd compatv10image.img.xz > $IMG10
;;
esac
......
......@@ -58,7 +58,7 @@ function test_required()
export LANG=C
test_required
[ ! -d $TST_DIR ] && tar xjf $srcdir/luks1-images.tar.bz2 --no-same-owner
[ ! -d $TST_DIR ] && tar xJf $srcdir/luks1-images.tar.xz --no-same-owner
echo "PASSPHRASE CHECK"
for file in $(ls $TST_DIR/luks1_*) ; do
......
......@@ -193,10 +193,10 @@ function test_logging_tmpfs() {
function test_logging() {
echo -n "$1:"
for img in $(ls img_fs*img.bz2) ; do
for img in $(ls img_fs*img.xz) ; do
wipefs -a $SCSI_DEV > /dev/null
echo -n "[${img%.img.bz2}]"
bzip2 -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
echo -n "[${img%.img.xz}]"
xz -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
mount_and_test $SCSI_DEV || return 1
done
echo
......
......@@ -197,10 +197,10 @@ function test_logging_tmpfs() {
function test_logging() {
echo -n "$1:"
for img in $(ls img_fs*img.bz2) ; do
for img in $(ls img_fs*img.xz) ; do
wipefs -a $SCSI_DEV > /dev/null
echo -n "[${img%.img.bz2}]"
bzip2 -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
echo -n "[${img%.img.xz}]"
xz -d -c $img | dd of=$SCSI_DEV bs=4k >/dev/null 2>&1
mount_and_test $SCSI_DEV || return 1
done
echo
......
......@@ -70,7 +70,7 @@ function test_required()
test_required
export LANG=C
[ ! -d $TST_DIR ] && tar xjf $srcdir/tcrypt-images.tar.bz2 --no-same-owner
[ ! -d $TST_DIR ] && tar xJf $srcdir/tcrypt-images.tar.xz --no-same-owner
echo "HEADER CHECK"
for file in $(ls $TST_DIR/[t]c_* $TST_DIR/vcpim_*) ; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment