diff options
Diffstat (limited to 'resources/libraries/python')
-rw-r--r-- | resources/libraries/python/Constants.py | 8 | ||||
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 18 | ||||
-rw-r--r-- | resources/libraries/python/PapiExecutor.py | 12 | ||||
-rw-r--r-- | resources/libraries/python/QemuUtils.py | 1 |
4 files changed, 20 insertions, 19 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py index faf861d89d..c21c5b8cc5 100644 --- a/resources/libraries/python/Constants.py +++ b/resources/libraries/python/Constants.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -179,13 +179,13 @@ class Constants: QEMU_VM_DPDK = u"/opt/dpdk-20.02" # Docker container SUT image - DOCKER_SUT_IMAGE_UBUNTU = u"snergster/csit-sut:latest" + DOCKER_SUT_IMAGE_UBUNTU = u"csit_sut-ubuntu2004:local" # Docker container arm SUT image - DOCKER_SUT_IMAGE_UBUNTU_ARM = u"snergster/csit-arm-sut:latest" + DOCKER_SUT_IMAGE_UBUNTU_ARM = u"csit_sut-ubuntu2004:local" # TRex install directory - TREX_INSTALL_DIR = u"/opt/trex-core-2.82" + TREX_INSTALL_DIR = u"/opt/trex-core-2.88" # TODO: Find the right way how to use it in trex profiles # TRex pcap files directory diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 77e139f80f..2810623e24 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -778,7 +778,7 @@ class LXC(ContainerEngine): else u"amd64" image = self.container.image if self.container.image \ - else f"-d ubuntu -r bionic -a {target_arch}" + else f"-d ubuntu -r focal -a {target_arch}" cmd = f"lxc-create -t download --name {self.container.name} " \ f"-- {image} --no-validate" @@ -1000,13 +1000,13 @@ class Docker(ContainerEngine): else Constants.DOCKER_SUT_IMAGE_UBUNTU setattr(self.container, u"image", img) - cmd = f"docker pull {self.container.image}" - - ret, _, _ = self.container.ssh.exec_command_sudo(cmd, timeout=1800) - if int(ret) != 0: - raise RuntimeError( - f"Failed to create container {self.container.name}." - ) + if "/" in self.container.image: + cmd = f"docker pull {self.container.image}" + ret, _, _ = self.container.ssh.exec_command_sudo(cmd, timeout=1800) + if int(ret) != 0: + raise RuntimeError( + f"Failed to create container {self.container.name}." + ) if self.container.cpuset_cpus: self._configure_cgroup(u"docker") diff --git a/resources/libraries/python/PapiExecutor.py b/resources/libraries/python/PapiExecutor.py index 46fe5d583b..f4d01704b3 100644 --- a/resources/libraries/python/PapiExecutor.py +++ b/resources/libraries/python/PapiExecutor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -23,6 +23,8 @@ import subprocess import sys import tempfile import time +from collections import UserDict + from pprint import pformat from robot.api import logger @@ -63,11 +65,11 @@ def dictize(obj): """ if not hasattr(obj, u"_asdict"): return obj - ret = obj._asdict() - old_get = ret.__getitem__ + overriden = UserDict(obj._asdict()) + old_get = overriden.__getitem__ new_get = lambda self, key: dictize(old_get(self, key)) - ret.__getitem__ = new_get - return ret + overriden.__getitem__ = new_get + return overriden class PapiSocketExecutor: diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index b29e19c035..b236090464 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -138,7 +138,6 @@ class QemuUtils: ) self._params.add_with_value(u"m", f"{self._opt.get(u'mem')}M") self._params.add_with_value(u"numa", u"node,memdev=mem") - self._params.add_with_value(u"balloon", u"none") def add_net_user(self): """Set managment port forwarding.""" |