Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource-query: test cases for set-property support
- Loading branch information
Showing
13 changed files
with
143 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,3 @@ | ||
set-property /tiny0/rack0/node0 class=1 | ||
get-property /tiny0/rack0/node0 | ||
quit |
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,7 @@ | ||
set-property /tiny0/rack0/node0 class=1 | ||
get-property /tiny0/rack0/node0 | ||
set-property /tiny0/rack0/node0/socket1 sockprop=abc | ||
get-property /tiny0/rack0/node0/socket1 | ||
set-property /tiny0/rack0/node1/socket0/core17 coreprop=z | ||
get-property /tiny0/rack0/node1/socket0/core17 | ||
quit |
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,2 @@ | ||
get-property /tiny0/rack0/node0 | ||
quit |
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,7 @@ | ||
set-property /tiny0/rack0/node0 prop1=a | ||
set-property /tiny0/rack0/node0 prop2=foo | ||
set-property /tiny0/rack0/node0 prop3=123 | ||
set-property /tiny0/rack0/node0 prop4=bar | ||
set-property /tiny0/rack0/node0 prop5=baz | ||
get-property /tiny0/rack0/node0 | ||
quit |
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,9 @@ | ||
set-property /tiny0/rack0/node0 prop1=a | ||
get-property /tiny0/rack0/node0 | ||
set-property /tiny0/rack0/node0 prop1=foo | ||
get-property /tiny0/rack0/node0 | ||
set-property /tiny0/rack0/node0 prop1=123 | ||
get-property /tiny0/rack0/node0 | ||
set-property /tiny0/rack0/node0 prop1=a | ||
get-property /tiny0/rack0/node0 | ||
quit |
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,21 @@ | ||
set-property /tiny0/rack0/node0 class | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 class= | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 =class | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 = | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 class==1 | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 class=1=class=random | ||
get-property /tiny0/rack0/node0 | ||
|
||
set-property /tiny0/rack0/node0 class=1 | ||
get-property /tiny0/rack0/node0 | ||
quit |
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 @@ | ||
class=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,3 @@ | ||
class=1 | ||
sockprop=abc | ||
coreprop=z |
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 @@ | ||
No properties were found for /tiny0/rack0/node0. |
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,5 @@ | ||
prop1=a | ||
prop2=foo | ||
prop3=123 | ||
prop4=bar | ||
prop5=baz |
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,4 @@ | ||
prop1=a | ||
prop1=foo | ||
prop1=123 | ||
prop1=a |
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,13 @@ | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
Incorrect input format. Please use `set-property <resource> PROPERTY=VALUE`. | ||
No properties were found for /tiny0/rack0/node0. | ||
class=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,67 @@ | ||
#!/bin/sh | ||
# set -x | ||
|
||
test_description='Test Set Property On Tiny Machine Configuration' | ||
|
||
. $(dirname $0)/sharness.sh | ||
|
||
cmd_dir="${SHARNESS_TEST_SRCDIR}/data/resource/commands/resource_property" | ||
exp_dir="${SHARNESS_TEST_SRCDIR}/data/resource/expected/resource_property" | ||
grugs="${SHARNESS_TEST_SRCDIR}/data/resource/grugs/tiny.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="set-property and get-property on the node type resource" | ||
test_expect_success "${test001_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds001} > cmds001 && | ||
${query} -G ${grugs} -S CA -P high -t 001.R.out < cmds001 && | ||
test_cmp 001.R.out ${exp_dir}/001.R.out | ||
' | ||
|
||
cmds002="${cmd_dir}/cmds02.in" | ||
test002_desc="set-property and get-property on the other resources" | ||
test_expect_success "${test002_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds002} > cmds002 && | ||
${query} -G ${grugs} -S CA -P high -t 002.R.out < cmds002 && | ||
test_cmp 002.R.out ${exp_dir}/002.R.out | ||
' | ||
|
||
cmds003="${cmd_dir}/cmds03.in" | ||
test003_desc="test get-property without setting any properties" | ||
test_expect_success "${test003_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds003} > cmds003 && | ||
${query} -G ${grugs} -S CA -P high -t 003.R.out < cmds003 && | ||
test_cmp 003.R.out ${exp_dir}/003.R.out | ||
' | ||
|
||
cmds004="${cmd_dir}/cmds04.in" | ||
test004_desc="test multiple properties for same resource" | ||
test_expect_success "${test004_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds004} > cmds004 && | ||
${query} -G ${grugs} -S CA -P high -t 004.R.out < cmds004 && | ||
test_cmp 004.R.out ${exp_dir}/004.R.out | ||
' | ||
|
||
cmds005="${cmd_dir}/cmds05.in" | ||
test005_desc="test inserting same property key multiple times" | ||
test_expect_success "${test005_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds005} > cmds005 && | ||
${query} -G ${grugs} -S CA -P high -t 005.R.out < cmds005 && | ||
test_cmp 005.R.out ${exp_dir}/005.R.out | ||
' | ||
|
||
cmds006="${cmd_dir}/cmds06.in" | ||
test006_desc="test incorrect inputs to set-property" | ||
test_expect_success "${test006_desc}" ' | ||
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds006} > cmds006 && | ||
${query} -G ${grugs} -S CA -P high -t 006.R.out < cmds006 && | ||
test_cmp 006.R.out ${exp_dir}/006.R.out | ||
' | ||
|
||
test_done |