From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 16/16] mg-schema-test-database: Add workflow doc comment Date: Mon, 7 Dec 2015 17:27:34 +0000 Message-ID: <1449509254-27007-17-git-send-email-ian.jackson@eu.citrix.com> References: <1449509254-27007-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a5zZn-0008D3-Mw for xen-devel@lists.xenproject.org; Mon, 07 Dec 2015 17:27:51 +0000 In-Reply-To: <1449509254-27007-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- v2: New patch --- mg-schema-test-database | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/mg-schema-test-database b/mg-schema-test-database index 90a361b..d704950 100755 --- a/mg-schema-test-database +++ b/mg-schema-test-database @@ -34,7 +34,42 @@ # NB that you can't drop a test database with these daemons running, # because Postgres will refuse to drop a database that anyone is # connected to. - +# +# +# Expected usage workflow: +# +# 1. Optionally, arrange for some hosts to be allocated to a suitable task +# OSSTEST_TASK=iwj@testing ./mg-allocate [-U ...] a-host +# +# 2. Create the test DB using the script +# ./mg-schema-test-database create [_SUFFIX] iwj@testing +# +# 3. Using the `export OSSTEST_CONFIG=' line printed by the above, +# play about in the test DB. `a-host' will be `idle' in the test DB: +# OSSTEST_CONFIG=\ +# /u/iwj/.xen-osstest/config:local-config.test-database_iwj \ +# ./mg-allocate a-host +# +# 3a. Maybe run ./mg-schema-test-database daemons (if full-on queue +# running is desired). +# +# 3b. Meanwhile from the point of view of other users of the main DB, +# `a-host' is borrowed by a special task, but the rest of the main +# DB and its hosts can carry on. +# +# 3c. When talking to the real database, while you have a test DB set +# up, you have to set OSSTEST_DB_USEREAL_IGNORETEST eg +# OSSTEST_DB_USEREAL_IGNORETEST=osstest_test_iwj ./sg-run-job etc. etc. +# This is just to stop you operating on the real DB by mistake. +# +# 4. When you are done, +# ./mg-schema-test-database drop [_SUFFIX] +# This will throw away all of the information in the test DB. +# +# 5. OSSTEST_TASK=iwj@testing ./mg-allocate !a-host +# Hosts that were marked in the main DB as borrowed, are returned by +# mg-schema-test-database to the main DB task that previously owned +# them, but not freed. So you need to explicitly free them. set -e -o posix ${OSSTEST_DEBUG:+-x} -- 1.7.10.4