-
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: add simple test for flux-simulator
- Loading branch information
1 parent
1205eff
commit ac28a43
Showing
3 changed files
with
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
JobID,NNodes,NCPUS,Timelimit,Submit,Elapsed | ||
1,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
2,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
3,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
4,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
5,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
6,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
7,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
8,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
9,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
10,10,160,00:10:00,2019-01-01T00:00:00,00:06:00 |
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,11 @@ | ||
JobID,NNodes,NCPUS,Timelimit,Submit,Elapsed | ||
1,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
2,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
3,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
4,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
5,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
6,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
7,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
8,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
9,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 | ||
10,1,16,00:10:00,2019-01-01T00:00:00,00:06:00 |
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,36 @@ | ||
#!/bin/sh | ||
|
||
test_description='Test flux simulator command' | ||
|
||
. $(dirname $0)/sharness.sh | ||
|
||
test_under_flux 1 | ||
|
||
# Set CLIMain log level to logging.DEBUG (10), to enable stack traces | ||
export FLUX_PYCLI_LOGLEVEL=10 | ||
|
||
flux setattr log-stderr-level 1 | ||
|
||
SIM_JOBTRACES_DIR=${SHARNESS_TEST_SRCDIR}/simulator/job-traces | ||
|
||
test_expect_success 'flux simulator fails with usage message' ' | ||
test_must_fail flux simulator 2>usage.err && | ||
grep -i usage: usage.err | ||
' | ||
|
||
test_expect_success 'flux simulator with single node works' ' | ||
flux simulator $SIM_JOBTRACES_DIR/10-single-node.csv 1 16 >run1.out && | ||
grep -i "utilization: 100" run1.out | ||
' | ||
|
||
test_expect_success 'flux simulator with multiple nodes works' ' | ||
flux simulator $SIM_JOBTRACES_DIR/10-single-node.csv 3 16 >run2.out && | ||
grep -i "utilization: 83" run2.out | ||
' | ||
|
||
test_expect_failure 'flux simulator errors out on unstaisfiable jobs' ' | ||
run_timeout 5 flux simulator $SIM_JOBTRACES_DIR/10-multi-node.csv 1 16 >run3.out 2>run3.err && | ||
grep -i "unsatisfiable" run3.err | ||
' | ||
|
||
test_done |