def test_admin_bash2(self): conn = Connection(hostname='Router', start=['mock_device_cli --os iosxr --state enable2'], os='iosxr', enable_password='******') with conn.admin_bash_console() as console: out = console.execute('pwd') self.assertIn('misc', out) ret = conn.spawn.match.match_output self.assertIn('exit', ret) self.assertIn('Router#', ret)
def test_admin_bash(self): conn = Connection(hostname='Router', start=['mock_device_cli --os iosxr --state enable1'], os='iosxr', enable_password='******') with conn.admin_bash_console() as console: console.execute('cd cisco_support/') out = console.execute('ls') self.assertIn('event_track', out) ret = conn.spawn.match.match_output self.assertIn('exit', ret) self.assertIn('Router#', ret)