Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
e961fd2d
Commit
e961fd2d
authored
Feb 14, 2013
by
Ilias Tsitsimpis
Committed by
Christos Stavrakakis
Feb 21, 2013
Browse files
Strengthen NetworkTestCase assertion checks
parent
48f1b0c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-tools/synnefo_tools/burnin.py
View file @
e961fd2d
...
...
@@ -1188,12 +1188,16 @@ class NetworkTestCase(unittest.TestCase):
for nic in nicsA:
if nic["network_id"] == self.networkid:
cls.priv_ip["A"] = nic["ipv4"]
self.result_dict["Server A private IP"] = str(cls.priv_ip["A"])
for nic in nicsB:
if nic["network_id"] == self.networkid:
cls.priv_ip["B"] = nic["ipv4"]
self.result_dict["Server B private IP"] = str(cls.priv_ip["B"])
self.assertTrue(conn_exists)
self.assertIsNot(cls.priv_ip["A"], "")
self.assertIsNot(cls.priv_ip["B"], "")
def test_002a_reboot(self):
"""
Rebooting
server
A
"""
...
...
@@ -1320,7 +1324,7 @@ class NetworkTestCase(unittest.TestCase):
self.assertTrue(s)
def test_003a_setup_interface_A(self):
"""
Set
up
eth1
for
server
A
"""
"""
Setup
eth1
for
server
A
"""
self._skipIf(self.is_windows, "only valid for Linux servers")
...
...
@@ -1345,11 +1349,14 @@ class NetworkTestCase(unittest.TestCase):
myPass = self.password['A']
log.info("SSH in server A as %s/%s" % (loginname, myPass))
command = "ifconfig eth1 %s" % self.priv_ip["A"]
command = "ifconfig eth1 %s && ifconfig eth1 | "
\
"grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"
\
% self.priv_ip["A"]
output, status = _ssh_execute(
hostip, loginname, myPass, command)
self.assertEquals(status, 0)
self.assertEquals(output[0].strip(), self.priv_ip["A"])
def test_003b_setup_interface_B(self):
"""
Setup
eth1
for
server
B
"""
...
...
@@ -1376,11 +1383,14 @@ class NetworkTestCase(unittest.TestCase):
myPass = self.password['B']
log.info("SSH in server B as %s/%s" % (loginname, myPass))
command = "ifconfig eth1 %s" % self.priv_ip["B"]
command = "ifconfig eth1 %s && ifconfig eth1 | "
\
"grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"
\
% self.priv_ip["B"]
output, status = _ssh_execute(
hostip, loginname, myPass, command)
self.assertEquals(status, 0)
self.assertEquals(output[0].strip(), self.priv_ip["B"])
def test_003c_test_connection_exists(self):
"""
Ping
server
B
from
server
A
to
test
if
connection
exists
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment