-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t/t2000-wreck-env.t: add tests for wreck global environment
Add tests for wreck global environment lwj.environ, and corresponding commands to manipulate and use that environemnt. Note: the test is split from t2000-wreck.t but still prefixed with t2000 for easier test devlepment, parallel tests, etc. Since this is short-lived code, it is probably ok for now.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
# | ||
|
||
test_description='Test basic wreck functionality | ||
Test basic functionality of wreckrun facility. | ||
' | ||
|
||
. `dirname $0`/sharness.sh | ||
SIZE=${FLUX_TEST_SIZE:-4} | ||
test_under_flux ${SIZE} wreck | ||
|
||
# Return the previous jobid | ||
last_job_id() { | ||
flux wreck last-jobid | ||
} | ||
# Return previous job path in kvs | ||
last_job_path() { | ||
flux wreck last-jobid -p | ||
} | ||
|
||
test_expect_success 'flux-wreck: setenv/getenv works' ' | ||
flux wreck setenv FOO=BAR && | ||
flux wreck getenv FOO | ||
' | ||
test_expect_success 'flux-wreck: unsetenv works' ' | ||
flux wreck unsetenv FOO && | ||
test "$(flux wreck getenv FOO)" = "FOO=" | ||
' | ||
test_expect_success 'flux-wreck: setenv all' ' | ||
flux wreck setenv all && | ||
flux env /usr/bin/env | sort | grep -ve FLUX_URI -e HOSTNAME -e ENVIRONMENT > env.expected && | ||
flux wreck getenv | sort > env.output && | ||
test_cmp env.expected env.output | ||
' | ||
test_expect_success 'wreck: global lwj.environ exported to jobs' ' | ||
flux wreck setenv FOO=bar && | ||
test "$(flux wreckrun -n1 printenv FOO)" = "bar" | ||
' | ||
test_expect_success 'wreck: wreckrun exports environment vars not in global env' ' | ||
BAR=baz flux wreckrun -n1 printenv BAR > printenv.out && | ||
test "$(cat printenv.out)" = "baz" | ||
' | ||
test_expect_success 'wreck: wreckrun --skip-env works' ' | ||
BAR=baz flux wreckrun --skip-env -n1 printenv BAR > printenv2.out || : && | ||
test "$(cat printenv2.out)" = "" | ||
' | ||
|
||
test_done |