@@ -158,6 +158,9 @@ sg-*: ?
ts-*: Test Step scripts.
+sa-*: Standalone mode.
+
+
Jobs
====
new file mode 100755
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2014 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 -e
+
+usage(){
+ cat <<END
+usage: ./sa-forget-flight [database] [flight]
+END
+}
+
+if [ $# -ne 2 ] ; then
+ usage >&2
+ exit 1
+fi
+
+db="$1"
+flight="$1"
+
+sqlite3 "$db" <<END
+ DELETE FROM runvars WHERE flight='$flight';
+ DELETE FROM jobs WHERE flight='$flight';
+ DELETE FROM flights WHERE flight='$flight';
+END
new file mode 100755
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2014 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 -e
+
+usage(){
+ cat <<END
+usage: ./sa-init-db [database]
+END
+}
+
+if [ $# -ne 1 ] ; then
+ usage >&2
+ exit 1
+fi
+
+db="$1"
+
+sqlite3 "$db" <<END
+ CREATE TABLE flights (
+ flight TEXT PRIMARY KEY,
+ blessing TEXT,
+ intended TEXT,
+ branch TEXT
+ );
+ CREATE TABLE jobs (
+ flight TEXT NOT NULL,
+ job TEXT NOT NULL,
+ recipe TEXT NOT NULL,
+ status TEXT NOT NULL,
+ PRIMARY KEY(flight,job)
+ );
+ CREATE TABLE runvars (
+ flight TEXT NOT NULL,
+ job TEXT NOT NULL,
+ name TEXT NOT NULL,
+ val TEXT NOT NULL,
+ synth BOOLEAN NOT NULL,
+ PRIMARY KEY(flight,job,name)
+ );
+END
@@ -131,35 +131,9 @@ case $# in
esac
if test -f standalone.db; then
- sqlite3 standalone.db <<END
- DELETE FROM runvars WHERE flight='$flight';
- DELETE FROM jobs WHERE flight='$flight';
- DELETE FROM flights WHERE flight='$flight';
-END
+ ./sa-forget-flight standalone.db "$flight"
else
- sqlite3 standalone.db <<END
- CREATE TABLE flights (
- flight TEXT PRIMARY KEY,
- blessing TEXT,
- intended TEXT,
- branch TEXT
- );
- CREATE TABLE jobs (
- flight TEXT NOT NULL,
- job TEXT NOT NULL,
- recipe TEXT NOT NULL,
- status TEXT NOT NULL,
- PRIMARY KEY(flight,job)
- );
- CREATE TABLE runvars (
- flight TEXT NOT NULL,
- job TEXT NOT NULL,
- name TEXT NOT NULL,
- val TEXT NOT NULL,
- synth BOOLEAN NOT NULL,
- PRIMARY KEY(flight,job,name)
- );
-END
+ ./sa-db-init standalone.db
fi
: ${BUILD_LVEXTEND_MAX:=50}
I sometimes want just these bits. I went with a new "sa" prefix, but I left standalone-reset alone since it is already reasonably well known. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- README | 3 +++ sa-forget-flight | 39 +++++++++++++++++++++++++++++++++++++++ sa-init-db | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ standalone-reset | 30 ++---------------------------- 4 files changed, 100 insertions(+), 28 deletions(-) create mode 100755 sa-forget-flight create mode 100755 sa-init-db