forked from metomi/rose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test with or without suite hosts. Check initial run OK. While suite running, check subsequence install, run, restart fails. While suite running, check reload works. And remove unnecessary test headers.
- Loading branch information
1 parent
7a475d4
commit 50cd2d3
Showing
26 changed files
with
138 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
#------------------------------------------------------------------------------- | ||
# (C) British Crown Copyright 2012-3 Met Office. | ||
# | ||
# This file is part of Rose, a framework for scientific suites. | ||
# | ||
# Rose is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Rose 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 General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Rose. If not, see <http://www.gnu.org/licenses/>. | ||
#------------------------------------------------------------------------------- | ||
# Test "rose suite-run", with and without site/user configurations. | ||
#------------------------------------------------------------------------------- | ||
. $(dirname $0)/test_header | ||
|
||
#------------------------------------------------------------------------------- | ||
N_TESTS=10 | ||
tests $N_TESTS | ||
#------------------------------------------------------------------------------- | ||
# Run the suite. | ||
if [[ $TEST_KEY_BASE == *conf ]]; then | ||
if ! rose config -q 'rose-suite-run' 'hosts'; then | ||
skip $N_TESTS '[rose-suite-run]hosts not defined' | ||
exit 0 | ||
fi | ||
else | ||
export ROSE_CONF_IGNORE=true | ||
fi | ||
TEST_KEY=$TEST_KEY_BASE | ||
SUITE_RUN_DIR=$(mktemp -d --tmpdir=$HOME/cylc-run 'rose-test-battery.XXXXXX') | ||
NAME=$(basename $SUITE_RUN_DIR) | ||
run_pass "$TEST_KEY" \ | ||
rose suite-run -C $TEST_SOURCE_DIR/$TEST_KEY_BASE --name=$NAME --no-gcontrol | ||
HOST=$(<$SUITE_RUN_DIR/log/rose-suite-run.host) | ||
#------------------------------------------------------------------------------- | ||
# "rose suite-run" should not work while suite is running. | ||
# except --reload mode. | ||
TEST_KEY=$TEST_KEY_BASE-running-run | ||
run_fail "$TEST_KEY" rose suite-run -i \ | ||
-C $TEST_SOURCE_DIR/$TEST_KEY_BASE --name=$NAME --no-gcontrol | ||
file_cmp "$TEST_KEY.err" "$TEST_KEY.err" <<__ERR__ | ||
[FAIL] $NAME: is already running on $HOST | ||
__ERR__ | ||
run_fail "$TEST_KEY" rose suite-run \ | ||
-C $TEST_SOURCE_DIR/$TEST_KEY_BASE --name=$NAME --no-gcontrol | ||
file_cmp "$TEST_KEY.err" "$TEST_KEY.err" <<__ERR__ | ||
[FAIL] $NAME: is already running on $HOST | ||
__ERR__ | ||
TEST_KEY=$TEST_KEY_BASE-running-restart | ||
run_fail "$TEST_KEY" rose suite-run --restart \ | ||
-C $TEST_SOURCE_DIR/$TEST_KEY_BASE --name=$NAME --no-gcontrol | ||
file_cmp "$TEST_KEY.err" "$TEST_KEY.err" <<__ERR__ | ||
[FAIL] $NAME: is already running on $HOST | ||
__ERR__ | ||
TEST_KEY=$TEST_KEY_BASE-running-reload | ||
run_pass "$TEST_KEY" rose suite-run --reload \ | ||
-C $TEST_SOURCE_DIR/$TEST_KEY_BASE --name=$NAME --no-gcontrol | ||
#------------------------------------------------------------------------------- | ||
# Wait for the suite to complete | ||
TEST_KEY=$TEST_KEY_BASE-suite-run-wait | ||
touch $SUITE_RUN_DIR/flag # allow the task to die | ||
TIMEOUT=$(($(date +%s) + 300)) # wait 5 minutes | ||
OK=false | ||
while [[ -e $HOME/.cylc/ports/$NAME ]] && (($(date +%s) < TIMEOUT)); do | ||
sleep 1 | ||
done | ||
if [[ -e $HOME/.cylc/ports/$NAME ]]; then | ||
fail "$TEST_KEY" | ||
exit 1 | ||
else | ||
OK=true | ||
pass "$TEST_KEY" | ||
fi | ||
#------------------------------------------------------------------------------- | ||
TEST_KEY=$TEST_KEY_BASE-clean | ||
run_pass "$TEST_KEY" rose suite-clean -y $NAME | ||
rmdir $SUITE_RUN_DIR || true | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
01-run-basic-conf |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!jinja2 | ||
[cylc] | ||
UTC mode = True | ||
[[event hooks]] | ||
timeout handler = "rose suite-hook --shutdown" | ||
timeout = 2 | ||
[scheduling] | ||
initial cycle time = 2013010100 | ||
final cycle time = 2013010200 | ||
[[dependencies]] | ||
[[[ 0, 12 ]]] | ||
graph = """ | ||
my_task_1 | ||
""" | ||
|
||
[runtime] | ||
[[root]] | ||
command scripting = """ | ||
I=0 | ||
OLD_I= | ||
while [[ ! -e $CYLC_SUITE_RUN_DIR/flag ]]; do | ||
sleep 1 | ||
((++I)) | ||
if [[ -n $OLD_I ]]; then | ||
echo -n $(tr '[:print:]' '\b' <<<"$OLD_I") | ||
fi | ||
echo -n $I | ||
OLD_I=$I | ||
done | ||
echo | ||
""" | ||
[[[event hooks]]] | ||
succeeded handler = "rose suite-hook" | ||
failed handler = "rose suite-hook --shutdown" | ||
submission failed handler = "rose suite-hook --shutdown" | ||
submission timeout handler = "rose suite-hook" | ||
execution timeout handler = "rose suite-hook" | ||
submission timeout = 1 | ||
execution timeout = 1 | ||
[[my_task_1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
00-run-basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
00-run-basic.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lib/bash/test_header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.