Skip to content

adjust @ifcfg_compliant_with_kickstart test changing setting variables in ifcfg-rh files

Thomas Haller requested to merge th/fix-ifcfg-clear-variable into master

When ifcfg-rh writer persists a connection profile to disk, it would first load the pre-existing file, modify it, and write it back.

In particular, it aims to keep comments and newlines, the order of variables, and unknown variables.

Until recently, when writing the profile NetworkManager would set the keys that make up the new profile, and explicitly clear some of the keys. Since [1] (1.23.1), NetworkManager will no longer explicitly clear any keys, instead, all (well known) keys that were not explicitly set will be cleared automatically.

In this case, there is a change in behavior because the variable BOOTPROTO would no longer be preserved. Just don't check for that.

You can see that previously the variable was unset, because it kept the single quotes BOOTPROTO='static'. Had NetworkManager touched the variable, it would have removed these quotes. But this variable was really bogus, it has no place in the profile as it is. It's good that we clear it now.

Note that entirely unknown variables would still be preserved.

[1] NetworkManager@07262b16


example failure: https://desktopqe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/beaker-NetworkManager-master-veth-rhel8-upstream/1233/artifact/artifacts/FAIL_report_NetworkManager-ci_Test682_ifcfg_compliant_with_kickstart.html

Merge request reports