Commit b4713721 authored by Paul Rich's avatar Paul Rich
Browse files

adding in nodeadm sanity test. Disambiguating option

parent d147f1af
......@@ -7,7 +7,7 @@ def test_nodeadm_args_1():
nodeadm test run: args_1
Command Output:
Usage: nodeadm.py [-l] [--down part1 part2] [--up part1 part2]"
Usage: nodeadm.py [flags] [part1 part2...]"
Command Error/Debug:No arguments or options provided
......@@ -47,7 +47,7 @@ def test_nodeadm_args_2():
nodeadm test run: args_2
Command Output:
Usage: nodeadm.py [-l] [--down part1 part2] [--up part1 part2]"
Usage: nodeadm.py [flags] [part1 part2...]"
Command Error/Debug:No arguments or options provided
......@@ -88,13 +88,13 @@ def test_nodeadm_combo_1():
Command Output:
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:Option combinations not allowed with: up option(s)
"""
args = """--up --down p1"""
exp_rs = 0
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
......@@ -125,13 +125,13 @@ def test_nodeadm_combo_2():
Command Output:
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:Option combinations not allowed with: list_nstates option(s)
"""
args = """--up -l p1"""
exp_rs = 0
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
......@@ -162,13 +162,13 @@ def test_nodeadm_combo_3():
Command Output:
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:Option combinations not allowed with: queue option(s)
"""
args = """--list --queue q1 p1"""
exp_rs = 0
args = """--list_nstates --queue q1 p1"""
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
......@@ -199,13 +199,13 @@ def test_nodeadm_combo_4():
Command Output:
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:Option combinations not allowed with: queue option(s)
"""
args = """--up --queue q1 p1"""
exp_rs = 0
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
......@@ -236,13 +236,13 @@ def test_nodeadm_combo_5():
Command Output:
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:Option combinations not allowed with: list_nstates option(s)
"""
args = """--down --list p1"""
exp_rs = 0
args = """--down --list_nstates p1"""
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
......@@ -272,9 +272,19 @@ def test_nodeadm_up_1():
nodeadm test run: up_1
Command Output:
nodes marked up:
U1
U2
U3
U4
U5
nodes that weren't in the down list:
p1
p2
p3
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:
"""
......@@ -309,9 +319,17 @@ def test_nodeadm_up_2():
nodeadm test run: up_2
Command Output:
nodes marked up:
U1
U2
U3
U4
U5
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
nodes that weren't in the down list:
p1
Command Error/Debug:
"""
......@@ -346,9 +364,19 @@ def test_nodeadm_down_1():
nodeadm test run: down_1
Command Output:
nodes marked down:
D1
D2
D3
D4
D5
unknown nodes:
p1
p2
p3
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:
"""
......@@ -383,6 +411,17 @@ def test_nodeadm_down_2():
nodeadm test run: down_2
Command Output:
nodes marked down:
D1
D2
D3
D4
D5
unknown nodes:
p1
p2
p3
Command Error/Debug:
nodeadm.py -d --down p1 p2 p3
......@@ -392,7 +431,18 @@ def test_nodeadm_down_2():
)
nodeadm is only supported on cluster systems. Try partlist instead.
component: "system.get_implementation", defer: False
get_implementation(
)
component: "system.nodes_down", defer: False
nodes_down(
['p1', 'p2', 'p3'],
gooduser,
)
"""
......@@ -428,9 +478,17 @@ def test_nodeadm_down_3():
nodeadm test run: down_3
Command Output:
nodes marked down:
D1
D2
D3
D4
D5
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
unknown nodes:
p1
Command Error/Debug:
"""
......@@ -465,9 +523,16 @@ def test_nodeadm_list_1():
nodeadm test run: list_1
Command Output:
Host Queue State Backfill
==============================
D1 QD1 good -
D2 QD2 bad -
D3 QD3 ugly -
U1 QU1 one -
U2 QU2 two -
U3 QU3 three -
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:
"""
......@@ -502,9 +567,16 @@ def test_nodeadm_list_2():
nodeadm test run: list_2
Command Output:
Host Queue State Backfill
==============================
D1 QD1 good -
D2 QD2 bad -
D3 QD3 ugly -
U1 QU1 one -
U2 QU2 two -
U3 QU3 three -
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:
"""
......@@ -533,13 +605,89 @@ def test_nodeadm_list_2():
assert result, errmsg
# ---------------------------------------------------------------------------------
def test_nodeadm_list_details_1():
"""
nodeadm test run: list_details_1
Command Output:
Usage: nodeadm.py [flags] [part1 part2...]"
Command Error/Debug:No arguments or options provided
"""
args = """-b"""
exp_rs = 256
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
results = testutils.run_cmd('nodeadm.py',_args,None)
rs = results[0]
cmd_out = results[1]
cmd_err = results[3]
# Test Pass Criterias
no_rs_err = (rs == exp_rs)
no_fatal_exc = (cmd_out.find("FATAL EXCEPTION") == -1)
result = no_rs_err and no_fatal_exc
errmsg = "\n\nFailed Data:\n\n" \
"Return Status %s, Expected Return Status %s\n\n" \
"Command Output:\n%s\n\n" \
"Command Error:\n%s\n\n" \
"Arguments: %s" % (str(rs), str(exp_rs), str(cmd_out), str(cmd_err), _args)
assert result, errmsg
# ---------------------------------------------------------------------------------
def test_nodeadm_list_details_2():
"""
nodeadm test run: list_details_2
Command Output:
Command Error/Debug:
"""
args = """-b D1"""
exp_rs = 0
user = pwd.getpwuid(os.getuid())[0]
_args = args.replace('<USER>',user)
results = testutils.run_cmd('nodeadm.py',_args,None)
rs = results[0]
cmd_out = results[1]
cmd_err = results[3]
# Test Pass Criterias
no_rs_err = (rs == exp_rs)
no_fatal_exc = (cmd_out.find("FATAL EXCEPTION") == -1)
result = no_rs_err and no_fatal_exc
errmsg = "\n\nFailed Data:\n\n" \
"Return Status %s, Expected Return Status %s\n\n" \
"Command Output:\n%s\n\n" \
"Command Error:\n%s\n\n" \
"Arguments: %s" % (str(rs), str(exp_rs), str(cmd_out), str(cmd_err), _args)
assert result, errmsg
# ---------------------------------------------------------------------------------
def test_nodeadm_queue_1():
"""
nodeadm test run: queue_1
Command Output:
Usage: nodeadm.py [-l] [--down part1 part2] [--up part1 part2]"
Usage: nodeadm.py [flags] [part1 part2...]"
Command Error/Debug:No arguments or options provided
......@@ -579,9 +727,9 @@ def test_nodeadm_queue_2():
nodeadm test run: queue_2
Command Output:
QU1 QD1
Command Error/Debug:nodeadm is only supported on cluster systems. Try partlist instead.
Command Error/Debug:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment