-
Notifications
You must be signed in to change notification settings - Fork 40
/
t3010-resource-power.t
executable file
·57 lines (46 loc) · 1.99 KB
/
t3010-resource-power.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
test_description='Test simple power allocation cases'
. $(dirname $0)/sharness.sh
cmd_dir="${SHARNESS_TEST_SRCDIR}/data/resource/commands/power"
exp_dir="${SHARNESS_TEST_SRCDIR}/data/resource/expected/power"
grugs="${SHARNESS_TEST_SRCDIR}/data/resource/grugs/power.graphml"
query="../../resource/utilities/resource-query"
#
# Selection Policy -- High ID first (-P high)
# The resource vertex with higher ID is preferred among its kind
# (e.g., node1 is preferred over node0 if available)
#
cmds001="${cmd_dir}/cmds01.in"
test001_desc="match allocate with simple power configuration (pol=hi)"
test_expect_success "${test001_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds001} > cmds001 &&
${query} -L ${grugs} -S PA -P high -t 001.R.out < cmds001 &&
test_cmp 001.R.out ${exp_dir}/001.R.out
'
#
# Selection Policy -- High ID first (-P low)
# The resource vertex with higher ID is preferred among its kind
# (e.g., node0 is preferred over node1 if available)
#
cmds002="${cmd_dir}/cmds01.in"
test002_desc="match allocate with simple power configuration (pol=low)"
test_expect_success "${test002_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds002} > cmds002 &&
${query} -L ${grugs} -S PA -P low -t 002.R.out < cmds002 &&
test_cmp 002.R.out ${exp_dir}/002.R.out
'
cmds011="${cmd_dir}/cmds01.in"
test011_desc="match allocate with simple power configuration (pol=hinodex)"
test_expect_success "${test011_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds011} > cmds011 &&
${query} -L ${grugs} -S PA -P hinodex -t 011.R.out < cmds011 &&
test_cmp 011.R.out ${exp_dir}/011.R.out
'
cmds021="${cmd_dir}/cmds01.in"
test021_desc="match allocate with simple power configuration (pol=lonodex)"
test_expect_success "${test021_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds021} > cmds021 &&
${query} -L ${grugs} -S PA -P lonodex -t 021.R.out < cmds021 &&
test_cmp 021.R.out ${exp_dir}/021.R.out
'
test_done