From 1c251bdf0574633e3249943dd444c1585b0a2ee7 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Fri, 25 May 2018 14:06:51 +0100 Subject: [PATCH] tests: Move osbuilder metadata var to top Moved the variable specifying the path to the osbuilder metadata file to the top of the script and made it readonly. Signed-off-by: James O. D. Hunt --- tests/image_creation.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/image_creation.bats b/tests/image_creation.bats index 9c3405dec4..de44bd342a 100644 --- a/tests/image_creation.bats +++ b/tests/image_creation.bats @@ -9,6 +9,7 @@ readonly image_builder_sh="$BATS_TEST_DIRNAME/../image-builder/image_builder.sh" readonly initrd_builder_sh="$BATS_TEST_DIRNAME/../initrd-builder/initrd_builder.sh" readonly tmp_dir=$(mktemp -t -d osbuilder-test.XXXXXXX) readonly tmp_rootfs="${tmp_dir}/rootfs-osbuilder" +readonly osbuilder_file="/var/lib/osbuilder/osbuilder.yaml" setup() { @@ -23,8 +24,7 @@ teardown(){ build_rootfs() { - local file="/var/lib/osbuilder/osbuilder.yaml" - local full="${tmp_rootfs}${file}" + local full="${tmp_rootfs}${osbuilder_file}" sudo -E ${rootfs_sh} -r "${tmp_rootfs}" "${distro}"