mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
support/testing: test_lxc.py: fix code style
Fix these warnings: E122 continuation line missing indentation or outdented E127 continuation line over-indented for visual indent E265 block comment should start with '# ' E302 expected 2 blank lines, found 1 F401 'pexpect' imported but unused Fixes: - https://gitlab.com/buildroot.org/buildroot/-/jobs/360824861 Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
335c0bc610
commit
bd18e74eeb
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import infra.basetest
|
import infra.basetest
|
||||||
import pexpect
|
|
||||||
|
|
||||||
class TestLxc(infra.basetest.BRTest):
|
class TestLxc(infra.basetest.BRTest):
|
||||||
config = \
|
config = \
|
||||||
@ -23,24 +23,24 @@ class TestLxc(infra.basetest.BRTest):
|
|||||||
BR2_ROOTFS_OVERLAY="{}"
|
BR2_ROOTFS_OVERLAY="{}"
|
||||||
BR2_TARGET_ROOTFS_CPIO=y
|
BR2_TARGET_ROOTFS_CPIO=y
|
||||||
""".format(
|
""".format(
|
||||||
infra.filepath("tests/package/test_lxc/lxc-kernel.config"),
|
infra.filepath("tests/package/test_lxc/lxc-kernel.config"),
|
||||||
infra.filepath("tests/package/test_lxc/rootfs-overlay"))
|
infra.filepath("tests/package/test_lxc/rootfs-overlay"))
|
||||||
|
|
||||||
def run_ok(self, cmd):
|
def run_ok(self, cmd):
|
||||||
self.assertRunOk(cmd, 120)
|
self.assertRunOk(cmd, 120)
|
||||||
|
|
||||||
def wait_boot(self):
|
def wait_boot(self):
|
||||||
#the complete boot with systemd takes more time than what the default multipler permits
|
# the complete boot with systemd takes more time than what the default multipler permits
|
||||||
self.emulator.timeout_multiplier *= 10
|
self.emulator.timeout_multiplier *= 10
|
||||||
self.emulator.login()
|
self.emulator.login()
|
||||||
|
|
||||||
def setup_run_test_container(self):
|
def setup_run_test_container(self):
|
||||||
self.run_ok("lxc-create -n lxc_iperf3 -t none -f /usr/share/lxc/config/minimal-iperf3.conf")
|
self.run_ok("lxc-create -n lxc_iperf3 -t none -f /usr/share/lxc/config/minimal-iperf3.conf")
|
||||||
self.run_ok("lxc-start -l trace -n lxc_iperf3 -o /tmp/lxc.log -L /tmp/lxc.console.log")
|
self.run_ok("lxc-start -l trace -n lxc_iperf3 -o /tmp/lxc.log -L /tmp/lxc.console.log")
|
||||||
#need to wait for the container to be fully started
|
# need to wait for the container to be fully started
|
||||||
self.run_ok("sleep 2")
|
self.run_ok("sleep 2")
|
||||||
self.run_ok("iperf3 -c 192.168.1.2 -t 2")
|
self.run_ok("iperf3 -c 192.168.1.2 -t 2")
|
||||||
#if the test fails, just cat /tmp/*.log
|
# if the test fails, just cat /tmp/*.log
|
||||||
|
|
||||||
def test_run(self):
|
def test_run(self):
|
||||||
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
|
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
|
||||||
@ -50,7 +50,7 @@ class TestLxc(infra.basetest.BRTest):
|
|||||||
kernel_cmdline=[
|
kernel_cmdline=[
|
||||||
"console=ttyAMA0,115200"],
|
"console=ttyAMA0,115200"],
|
||||||
options=["-initrd", cpio_file,
|
options=["-initrd", cpio_file,
|
||||||
"-dtb", dtb_file,
|
"-dtb", dtb_file,
|
||||||
"-M", "vexpress-a9"])
|
"-M", "vexpress-a9"])
|
||||||
self.wait_boot()
|
self.wait_boot()
|
||||||
self.setup_run_test_container()
|
self.setup_run_test_container()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user