]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
ts-memdisk-try-append: introduce a script to test memdisk options
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 28 Jul 2017 15:05:18 +0000 (16:05 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Oct 2017 11:04:31 +0000 (12:04 +0100)
The intended usage is to run this script against every host in order
to record the possible needed memdisk flags.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v12:
 - Add hyphens to the boot test options.

Changes since v1:
 - Get the arch of the job and exit with 0 if it's not supported.
 - Pass the --recordappend argument to ts-memdisk-try-append.

ts-memdisk-try-append [new file with mode: 0755]

diff --git a/ts-memdisk-try-append b/ts-memdisk-try-append
new file mode 100755 (executable)
index 0000000..67c250b
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2017 Citrix Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -xe -o posix
+
+arch=`perl -e '
+                use Osstest;
+                use Osstest::TestSupport;
+
+                tsreadconfig();
+                print $r{"arch"} or die $!;
+              '`
+
+case "$arch" in
+amd64)
+    ;;
+*)
+    echo "Arch $arch not supported for memdisk tests"
+    exit 0
+    ;;
+esac
+
+if ./ts-freebsd-host-install --test-boot --record-append $@; then
+    exit 0
+elif ./ts-freebsd-host-install --test-boot --record-append \
+                               --memdisk-append="raw" $@; then
+    exit 0
+fi
+
+exit 1