[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/44] Acceptance Tests: add port redirection for ssh by default
From: |
John Snow |
Subject: |
[PULL 06/44] Acceptance Tests: add port redirection for ssh by default |
Date: |
Thu, 27 May 2021 22:31:42 -0400 |
From: Cleber Rosa <crosa@redhat.com>
For users of the LinuxTest class, let's set up the VM with the port
redirection for SSH, instead of requiring each test to set the same
arguments.
It also sets the network device, by default, to virtio-net.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210412044644.55083-6-crosa@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/acceptance/avocado_qemu/__init__.py | 5 ++++-
tests/acceptance/virtiofs_submounts.py | 4 ----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index 67f75f66e56..0856880000f 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -309,10 +309,13 @@ class LinuxTest(Test, LinuxSSHMixIn):
timeout = 900
chksum = None
- def setUp(self, ssh_pubkey=None):
+ def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
super(LinuxTest, self).setUp()
self.vm.add_args('-smp', '2')
self.vm.add_args('-m', '1024')
+ # The following network device allows for SSH connections
+ self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
+ '-device', '%s,netdev=vnet' % network_device_type)
self.set_up_boot()
if ssh_pubkey is None:
ssh_pubkey, self.ssh_key = self.set_up_existing_ssh_keys()
diff --git a/tests/acceptance/virtiofs_submounts.py
b/tests/acceptance/virtiofs_submounts.py
index bed8ce44dfc..e10a935ac4e 100644
--- a/tests/acceptance/virtiofs_submounts.py
+++ b/tests/acceptance/virtiofs_submounts.py
@@ -207,10 +207,6 @@ def setUp(self):
self.vm.add_args('-kernel', vmlinuz,
'-append', 'console=ttyS0 root=/dev/sda1')
- # Allow us to connect to SSH
- self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
- '-device', 'virtio-net,netdev=vnet')
-
self.require_accelerator("kvm")
self.vm.add_args('-accel', 'kvm')
--
2.31.1
- [PULL 00/44] Python patches, John Snow, 2021/05/27
- [PULL 01/44] Python: expose QEMUMachine's temporary directory, John Snow, 2021/05/27
- [PULL 02/44] tests/acceptance/virtiofs_submounts.py: add missing accel tag, John Snow, 2021/05/27
- [PULL 03/44] tests/acceptance/virtiofs_submounts.py: evaluate string not length, John Snow, 2021/05/27
- [PULL 04/44] Python: add utility function for retrieving port redirection, John Snow, 2021/05/27
- [PULL 05/44] Acceptance Tests: move useful ssh methods to base class, John Snow, 2021/05/27
- [PULL 06/44] Acceptance Tests: add port redirection for ssh by default,
John Snow <=
- [PULL 07/44] Acceptance Tests: make username/password configurable, John Snow, 2021/05/27
- [PULL 08/44] Acceptance Tests: set up SSH connection by default after boot for LinuxTest, John Snow, 2021/05/27
- [PULL 09/44] tests/acceptance/virtiofs_submounts.py: remove launch_vm(), John Snow, 2021/05/27
- [PULL 10/44] Acceptance Tests: add basic documentation on LinuxTest base class, John Snow, 2021/05/27
- [PULL 11/44] Acceptance Tests: introduce CPU hotplug test, John Snow, 2021/05/27
- [PULL 13/44] acceptance tests: bump Avocado version to 88.1, John Snow, 2021/05/27
- [PULL 12/44] tests/acceptance/virtiofs_submounts.py: fix setup of SSH pubkey, John Snow, 2021/05/27
- [PULL 14/44] python/console_socket: avoid one-letter variable, John Snow, 2021/05/27
- [PULL 15/44] python/machine: use subprocess.DEVNULL instead of open(os.path.devnull), John Snow, 2021/05/27
- [PULL 16/44] python/machine: use subprocess.run instead of subprocess.Popen, John Snow, 2021/05/27