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 <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2018-05-25 14:06:51 +01:00
parent c69eb00f9b
commit 1c251bdf05

View File

@ -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}"