From f19ba12360d1d1f460df54f55a6aa49eaa0cef1a Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Sat, 31 Aug 2013 23:04:48 +0200 Subject: [PATCH] tests: don't create a syslinux stub unconditionally in libtest libtest.sh has an setup_os_repository() helper function tha is used by many tests to setup an OSTree initial repository. This function creates an syslinux configuration unconditionally but OSTree supports other bootloader backends besides syslinux. So, is better to conditionally create a syslinux configuration only when it is needed. https://bugzilla.gnome.org/show_bug.cgi?id=708069 Signed-off-by: Javier Martinez Canillas --- tests/libtest.sh | 21 ++++++++++++++------- tests/test-admin-deploy-1.sh | 2 +- tests/test-admin-deploy-2.sh | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/libtest.sh b/tests/libtest.sh index eeedf915..b05e72bc 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -155,8 +155,19 @@ setup_fake_remote_repo1() { export OSTREE="ostree --repo=repo" } +setup_os_boot_syslinux() { + # Stub syslinux configuration + mkdir -p sysroot/boot/loader.0 + ln -s loader.0 sysroot/boot/loader + touch sysroot/boot/loader/syslinux.cfg + # And a compatibility symlink + mkdir -p sysroot/boot/syslinux + ln -s ../loader/syslinux.cfg sysroot/boot/syslinux/syslinux.cfg +} + setup_os_repository () { mode=$1 + bootmode=$2 shift oldpwd=`pwd` @@ -207,13 +218,9 @@ EOF ostree admin --sysroot=sysroot init-fs sysroot ostree admin --sysroot=sysroot os-init testos - # Stub syslinux configuration - mkdir -p sysroot/boot/loader.0 - ln -s loader.0 sysroot/boot/loader - touch sysroot/boot/loader/syslinux.cfg - # And a compatibility symlink - mkdir -p sysroot/boot/syslinux - ln -s ../loader/syslinux.cfg sysroot/boot/syslinux/syslinux.cfg + if [ $bootmode = "syslinux" ]; then + setup_os_boot_syslinux + fi } os_repository_new_commit () diff --git a/tests/test-admin-deploy-1.sh b/tests/test-admin-deploy-1.sh index fbf9fc27..62580a4c 100755 --- a/tests/test-admin-deploy-1.sh +++ b/tests/test-admin-deploy-1.sh @@ -23,7 +23,7 @@ set -e echo "1..1" -setup_os_repository "archive-z2" +setup_os_repository "archive-z2" "syslinux" echo "ok setup" diff --git a/tests/test-admin-deploy-2.sh b/tests/test-admin-deploy-2.sh index d7ddf5f5..a133e701 100755 --- a/tests/test-admin-deploy-2.sh +++ b/tests/test-admin-deploy-2.sh @@ -23,7 +23,7 @@ set -e echo "1..1" -setup_os_repository "archive-z2" +setup_os_repository "archive-z2" "syslinux" echo "ok setup"