aboutsummaryrefslogtreecommitdiff
path: root/tests/vm/basevm.py
diff options
context:
space:
mode:
authorRobert Foley <robert.foley@linaro.org>2020-07-01 14:56:23 +0100
committerAlex Bennée <alex.bennee@linaro.org>2020-07-11 15:52:59 +0100
commitdf00168039c8a58db3c33456db2c00da51043ee2 (patch)
tree103b1c033a813803292df0b35d929b3800960033 /tests/vm/basevm.py
parentd322fe2daf1bd3572b7917f6beafbc1cfbfe50fe (diff)
tests/vm: change scripts to use self._config
This change converts existing scripts to using for example self.ROOT_PASS, to self._config['root_pass']. We made similar changes for GUEST_USER, and GUEST_PASS. This allows us also to remove the change in basevm.py, which adds __getattr__ for backwards compatibility. Signed-off-by: Robert Foley <robert.foley@linaro.org> Reviewed-by: Peter Puhov <peter.puhov@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200601211421.1277-8-robert.foley@linaro.org> Message-Id: <20200701135652.1366-12-alex.bennee@linaro.org>
Diffstat (limited to 'tests/vm/basevm.py')
-rw-r--r--tests/vm/basevm.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 53c35fadde..15aec593e5 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -183,13 +183,6 @@ class BaseVM(object):
self.console_init(timeout=timeout)
self.console_wait(wait_string)
- def __getattr__(self, name):
- # Support direct access to config by key.
- # for example, access self._config['cpu'] by self.cpu
- if name.lower() in self._config.keys():
- return self._config[name.lower()]
- return object.__getattribute__(self, name)
-
def _download_with_cache(self, url, sha256sum=None, sha512sum=None):
def check_sha256sum(fname):
if not sha256sum:
@@ -239,13 +232,13 @@ class BaseVM(object):
return r
def ssh(self, *cmd):
- return self._ssh_do(self.GUEST_USER, cmd, False)
+ return self._ssh_do(self._config["guest_user"], cmd, False)
def ssh_root(self, *cmd):
return self._ssh_do("root", cmd, False)
def ssh_check(self, *cmd):
- self._ssh_do(self.GUEST_USER, cmd, True)
+ self._ssh_do(self._config["guest_user"], cmd, True)
def ssh_root_check(self, *cmd):
self._ssh_do("root", cmd, True)