self.assertEqual(subprocess.call(['ip', 'link', 'add', 'dummy98', 'type', 'dummy']), 0)
self.assertEqual(subprocess.call(['ip', 'link', 'set', 'dummy98', 'up']), 0)
- time.sleep(4)
+ time.sleep(2)
output = subprocess.check_output(['ip', 'address', 'show', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, 'UP,LOWER_UP')
self.assertEqual(subprocess.call(['ip', 'link', 'add', 'dummy99', 'type', 'dummy']), 0)
self.assertEqual(subprocess.call(['ip', 'link', 'set', 'dummy99', 'up']), 0)
- time.sleep(4)
+ time.sleep(2)
output = subprocess.check_output(['ip', 'address', 'show', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, 'UP,LOWER_UP')
self.assertRegex(output, 'State: routable \(configured\)')
self.assertEqual(subprocess.call(['ip', 'link', 'del', 'dummy98']), 0)
- time.sleep(4)
+ time.sleep(2)
output = subprocess.check_output(['ip', 'address', 'show', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, 'UP,LOWER_UP')
self.assertRegex(output, 'State: routable \(configured\)')
self.assertEqual(subprocess.call(['ip', 'link', 'del', 'dummy99']), 0)
- time.sleep(4)
+ time.sleep(2)
output = subprocess.check_output(['ip', 'address', 'show', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertNotRegex(output, 'UP,LOWER_UP')
self.assertEqual(subprocess.call(['ip', 'link', 'add', 'dummy98', 'type', 'dummy']), 0)
self.assertEqual(subprocess.call(['ip', 'link', 'set', 'dummy98', 'up']), 0)
- time.sleep(4)
+ time.sleep(2)
output = subprocess.check_output(['ip', 'address', 'show', 'test1']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, 'UP,LOWER_UP')