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>
This commit is contained in:
Javier Martinez Canillas 2013-08-31 23:04:48 +02:00 committed by Colin Walters
parent d302c3d7ff
commit f19ba12360
3 changed files with 16 additions and 9 deletions

View File

@ -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 ()

View File

@ -23,7 +23,7 @@ set -e
echo "1..1"
setup_os_repository "archive-z2"
setup_os_repository "archive-z2" "syslinux"
echo "ok setup"

View File

@ -23,7 +23,7 @@ set -e
echo "1..1"
setup_os_repository "archive-z2"
setup_os_repository "archive-z2" "syslinux"
echo "ok setup"