[ostree] tests: don't create a syslinux stub unconditionally in libtest



commit f19ba12360d1d1f460df54f55a6aa49eaa0cef1a
Author: Javier Martinez Canillas <javier martinez collabora co uk>
Date:   Sat Aug 31 23:04:48 2013 +0200

    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 <javier martinez collabora co uk>

 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 eeedf91..b05e72b 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 fbf9fc2..62580a4 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 d7ddf5f..a133e70 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"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]