poky/meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
Mikko Rapeli 0fa5032fbe oeqq/runtime/ethernet_ip_connman: remove test_set_virtual_ip reference
It was removed. Fixes test loading after testexport.bbclass
has exported the tests:

oeqa.core.exception.OEQADependency: TestCase ethernet_ip_connman.Ethernet_Test.test_get_ip_from_dhcp depends on ethe
rnet_ip_connman.Ethernet_Test.test_set_virtual_ip and isn't available, cases available odict_keys(['apt.AptRepoTest.
test_apt_install_from_repo', 'boot.BootTest.test_reboot', 'buildcpio.BuildCpioTest.test_cpio', ...

(From OE-Core rev: 6112eb97e20c1fb38acb9e78e89876c4302f65b8)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-26 11:02:34 +01:00

24 lines
1.0 KiB
Python

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfQemu
class Ethernet_Test(OERuntimeTestCase):
@skipIfQemu()
def test_get_ip_from_dhcp(self):
(status, output) = self.target.run("connmanctl services | grep -E '*AO Wired|*AR Wired' | awk '{print $3}'")
self.assertEqual(status, 0, msg='No wired interfaces are detected, output: %s' % output)
wired_interfaces = output
(status, output) = self.target.run("ip route | grep default | awk '{print $3}'")
self.assertEqual(status, 0, msg='Failed to retrieve the default gateway, output: %s' % output)
default_gateway = output
(status, output) = self.target.run("connmanctl config %s --ipv4 dhcp && sleep 2 && ping -c 5 %s" % (wired_interfaces,default_gateway))
self.assertEqual(status, 0, msg='Failed to get dynamic IP address via DHCP in connmand, output: %s' % output)