Actually move vyos tests to network_cli (#33710)

* Fix vyos on network_cli on python3

bytes do not have format() in Python3

* Push connection to tasks, with bonus connection=local test

* Run tests without explicit connection set

* Add/update START messages where appropriate
This commit is contained in:
Nathaniel Case 2017-12-13 14:30:24 -05:00 committed by GitHub
commit 2425374fdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 169 additions and 51 deletions

View file

@ -55,18 +55,18 @@ class Cliconf(CliconfBase):
return self.send_command(b'show configuration commands')
def edit_config(self, command):
for cmd in chain([b'configure'], to_list(command)):
self.send_command(cmd)
for cmd in chain(['configure'], to_list(command)):
self.send_command(to_bytes(cmd))
def get(self, command, prompt=None, answer=None, sendonly=False):
return self.send_command(to_bytes(command), prompt=to_bytes(prompt), answer=to_bytes(answer), sendonly=sendonly)
def commit(self, comment=None):
if comment:
command = b'commit comment "{0}"'.format(comment)
command = 'commit comment "{0}"'.format(comment)
else:
command = b'commit'
self.send_command(command)
command = 'commit'
self.send_command(to_bytes(command))
def discard_changes(self, *args, **kwargs):
self.send_command(b'discard')