mooli tayer has uploaded a new change for review. Change subject: tool-tests: use variable from conf version in template files. ......................................................................
tool-tests: use variable from conf version in template files. Replace CONF_VERSION with current value from libvirt configure. This will save having to update all toolTests_*.conf files each time we bump a version. Change-Id: I1f322cc647f81358febbcb89b8ec67fd2a2b2270 Signed-off-by: Mooli Tayer <[email protected]> --- M tests/toolTests.py M tests/toolTests_lconf_ssl.conf M tests/toolTests_libvirt_logrotate.conf M tests/toolTests_libvirtd.conf M tests/toolTests_qemu_sanlock.conf M tests/toolTests_qemu_ssl.conf 6 files changed, 18 insertions(+), 14 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/32713/1 diff --git a/tests/toolTests.py b/tests/toolTests.py index a66443d..2bb606d 100644 --- a/tests/toolTests.py +++ b/tests/toolTests.py @@ -307,10 +307,14 @@ # helpers def _setConfig(self, *configurations): for file_, type_ in configurations: - shutil.copyfile( - os.path.join(dirName, 'toolTests_' + type_ + '.conf'), - self.test_env[file_] - ) + with open(self.test_env[file_], "wt") as fout: + with open( + os.path.join(dirName, 'toolTests_' + type_ + '.conf'), + "rt") as fin: + for line in fin: + fout.write(line.replace( + 'CONF_VERSION', + Libvirt.CONF_VERSION)) def testValidatePositive(self): libvirtConfigure = Libvirt() diff --git a/tests/toolTests_lconf_ssl.conf b/tests/toolTests_lconf_ssl.conf index 64b9c1a..ed29482 100644 --- a/tests/toolTests_lconf_ssl.conf +++ b/tests/toolTests_lconf_ssl.conf @@ -1,4 +1,4 @@ -## beginning of configuration section by vdsm-4.13.0 +## beginning of configuration section by vdsm-CONF_VERSION listen_tcp=0 auth_tcp="sasl" listen_addr="0.0.0.0" @@ -10,4 +10,4 @@ log_outputs="1:file:/var/log/libvirt/libvirtd.log" ca_file="/etc/pki/vdsm/certs/cacert.pem" cert_file="/etc/pki/vdsm/certs/vdsmcert.pem\" -## end of configuration section by vdsm-4.13.0 +## end of configuration section by vdsm-CONF_VERSION diff --git a/tests/toolTests_libvirt_logrotate.conf b/tests/toolTests_libvirt_logrotate.conf index 5bf4272..16f853f 100644 --- a/tests/toolTests_libvirt_logrotate.conf +++ b/tests/toolTests_libvirt_logrotate.conf @@ -1,4 +1,4 @@ -## beginning of configuration section by vdsm-4.13.0 +## beginning of configuration section by vdsm-CONF_VERSION /var/log/libvirt/libvirtd.log { rotate 100 missingok @@ -9,7 +9,7 @@ uncompresscmd /usr/bin/unxz compressext .xz } -## end of configuration section by vdsm-4.13.0 +## end of configuration section by vdsm-CONF_VERSION # VDSM backup/var/log/libvirt/libvirtd.log { # VDSM backup weekly # VDSM backup missingok diff --git a/tests/toolTests_libvirtd.conf b/tests/toolTests_libvirtd.conf index 20b5f8c..326b398 100644 --- a/tests/toolTests_libvirtd.conf +++ b/tests/toolTests_libvirtd.conf @@ -1,4 +1,4 @@ -## beginning of configuration section by vdsm-4.13.0 +## beginning of configuration section by vdsm-CONF_VERSION auto_disk_leases=0 require_lease_for_disks=0 -## end of configuration section by vdsm-4.13.0 +## end of configuration section by vdsm-CONF_VERSION diff --git a/tests/toolTests_qemu_sanlock.conf b/tests/toolTests_qemu_sanlock.conf index d41018f..d0098e0 100644 --- a/tests/toolTests_qemu_sanlock.conf +++ b/tests/toolTests_qemu_sanlock.conf @@ -1,4 +1,4 @@ -## beginning of configuration section by vdsm-4.13.0 +## beginning of configuration section by vdsm-CONF_VERSION LIBVIRTD_ARGS=--listen DAEMON_COREFILE_LIMIT=unlimited -## end of configuration section by vdsm-4.13.0 +## end of configuration section by vdsm-CONF_VERSION diff --git a/tests/toolTests_qemu_ssl.conf b/tests/toolTests_qemu_ssl.conf index 29e1e29..95eba0a 100644 --- a/tests/toolTests_qemu_ssl.conf +++ b/tests/toolTests_qemu_ssl.conf @@ -1,4 +1,4 @@ -## beginning of configuration section by vdsm-4.13.0 +## beginning of configuration section by vdsm-CONF_VERSION spice_tls=1 dynamic_ownership=0 save_image_format="lzop" @@ -7,4 +7,4 @@ remote_display_port_max=6923 lock_manager="sanlock" auto_dump_path="/var/log/core" -## end of configuration section by vdsm-4.13.0 +## end of configuration section by vdsm-CONF_VERSION -- To view, visit http://gerrit.ovirt.org/32713 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f322cc647f81358febbcb89b8ec67fd2a2b2270 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: mooli tayer <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
