From cea74a7b3e2e8c8eff65c68354f0b16e8558a888 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Tue, 25 Oct 2022 18:02:04 +0800 Subject: [PATCH] tests: use .nmconnection to set up test network F36 has dropped support on ifcfg and as a result current network tests fails. Use .nmconnection to set up test network instead. Signed-off-by: Coiby Xu Reviewed-by: Philipp Rudo --- tests/scripts/testcases/nfs-kdump/0-server.sh | 13 +++++++------ tests/scripts/testcases/ssh-kdump/0-server.sh | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/scripts/testcases/nfs-kdump/0-server.sh b/tests/scripts/testcases/nfs-kdump/0-server.sh index cf54e70..5436d3d 100755 --- a/tests/scripts/testcases/nfs-kdump/0-server.sh +++ b/tests/scripts/testcases/nfs-kdump/0-server.sh @@ -16,12 +16,13 @@ on_build() { img_run_cmd "echo dhcp-range=192.168.77.50,192.168.77.100,255.255.255.0,12h >> /etc/dnsmasq.conf" img_run_cmd "systemctl enable dnsmasq" - img_run_cmd 'echo DEVICE="eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo BOOTPROTO="none" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo ONBOOT="yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo PREFIX="24" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo IPADDR="192.168.77.1" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo TYPE="Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-eth0' + img_run_cmd 'echo [connection] > /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo type=ethernet >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo interface-name=eth0 >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo [ipv4] >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo address1=192.168.77.1/24 >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo method=manual >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'chmod 600 /etc/NetworkManager/system-connections/eth0.nmconnection' img_add_qemu_cmd "-nic socket,listen=:8010,mac=52:54:00:12:34:56" } diff --git a/tests/scripts/testcases/ssh-kdump/0-server.sh b/tests/scripts/testcases/ssh-kdump/0-server.sh index 6dfcc91..b4b84c9 100755 --- a/tests/scripts/testcases/ssh-kdump/0-server.sh +++ b/tests/scripts/testcases/ssh-kdump/0-server.sh @@ -17,12 +17,13 @@ on_build() { img_run_cmd "echo dhcp-range=192.168.77.50,192.168.77.100,255.255.255.0,12h >> /etc/dnsmasq.conf" img_run_cmd "systemctl enable dnsmasq" - img_run_cmd 'echo DEVICE="eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo BOOTPROTO="none >> /etc/sysconfig/network-scripts/ifcfg-eth0"' - img_run_cmd 'echo ONBOOT="yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo PREFIX="24" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo IPADDR="192.168.77.1" >> /etc/sysconfig/network-scripts/ifcfg-eth0' - img_run_cmd 'echo TYPE="Ethernet" >> /etc/sysconfig/network-scripts/ifcfg-eth0' + img_run_cmd 'echo [connection] > /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo type=ethernet >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo interface-name=eth0 >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo [ipv4] >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo address1=192.168.77.1/24 >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'echo method=manual >> /etc/NetworkManager/system-connections/eth0.nmconnection' + img_run_cmd 'chmod 600 /etc/NetworkManager/system-connections/eth0.nmconnection' } # Executed when VM boots