This patch introduces new style of versioning of LNST.
We will now use Major+minor style of versions, where major versions are based on major releases of our RPM packages and minor versions are only distinguished in devel GIT versions.
The version starts on 8.0
Each time a change is introduced, which may cause invalid behaviour when used with older version, developer should also increment minor version in this variable.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Common/Utils.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py index cb2272d..ea80a02 100644 --- a/lnst/Common/Utils.py +++ b/lnst/Common/Utils.py @@ -24,6 +24,8 @@ import math from _ast import Call, Attribute from lnst.Common.ExecCmd import exec_cmd
+LNST_VERSION = 8.0 + def die_when_parent_die(): try: import ctypes
This is used for comparing versions with Controller.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Slave/NetTestSlave.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py index 9104e31..c2fb911 100644 --- a/lnst/Slave/NetTestSlave.py +++ b/lnst/Slave/NetTestSlave.py @@ -30,7 +30,7 @@ from lnst.Common.ResourceCache import ResourceCache from lnst.Common.NetTestCommand import NetTestCommandContext from lnst.Common.NetTestCommand import NetTestCommand from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT -from lnst.Common.Utils import check_process_running +from lnst.Common.Utils import check_process_running, LNST_VERSION from lnst.Common.ConnectionHandler import send_data from lnst.Common.ConnectionHandler import ConnectionHandler from lnst.Common.Config import lnst_config @@ -95,6 +95,7 @@ class SlaveMethods: r_release, _ = exec_cmd("cat /etc/redhat-release", False, False, False) slave_desc["kernel_release"] = k_release.strip() slave_desc["redhat_release"] = r_release.strip() + slave_desc["lnst_version"] = LNST_VERSION
return ("hello", slave_desc)
When major versions differ, Controller execution is ended with an error. If only minor versions differ, warning message is logged and test is executed.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Controller/Machine.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py index 14a8061..5340804 100644 --- a/lnst/Controller/Machine.py +++ b/lnst/Controller/Machine.py @@ -21,7 +21,7 @@ from xmlrpclib import Binary from lnst.Common.Config import lnst_config from lnst.Common.NetUtils import normalize_hwaddr from lnst.Common.Utils import wait_for, create_tar_archive -from lnst.Common.Utils import check_process_running +from lnst.Common.Utils import check_process_running, LNST_VERSION from lnst.Common.NetTestCommand import DEFAULT_TIMEOUT
# conditional support for libvirt @@ -193,6 +193,22 @@ class Machine(object): "to machine %s, handshake failed!" % hostname raise MachineError(msg)
+ # Check if slave_desc["lnst_version"] exists + if "lnst_version" not in slave_desc: + msg = "Machine %s (%s) uses version older than 8.0"\ + % (m_id, hostname) + logging.error(msg) + raise MachineError(msg) + # Major version comparement + elif int(slave_desc["lnst_version"]) != int(LNST_VERSION): + msg = "Major version differs on machine %s (%s)" % (m_id, hostname) + logging.error(msg) + raise MachineError(msg) + # Minor version comparement + elif slave_desc["lnst_version"] != LNST_VERSION: + logging.warning("Minor version differs on machine %s (%s)" + % (m_id, hostname)) + self._slave_desc = slave_desc
for iface in self._interfaces:
Tue, Sep 08, 2015 at 04:20:35PM CEST, jprochaz@redhat.com wrote:
This patch introduces new style of versioning of LNST.
We will now use Major+minor style of versions, where major versions are based on major releases of our RPM packages and minor versions are only distinguished in devel GIT versions.
The version starts on 8.0
Each time a change is introduced, which may cause invalid behaviour when used with older version, developer should also increment minor version in this variable.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
NACK! I would like to at least discuss this first. Now, this does not make any sense to me.
lnst/Common/Utils.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py index cb2272d..ea80a02 100644 --- a/lnst/Common/Utils.py +++ b/lnst/Common/Utils.py @@ -24,6 +24,8 @@ import math from _ast import Call, Attribute from lnst.Common.ExecCmd import exec_cmd
+LNST_VERSION = 8.0
def die_when_parent_die(): try: import ctypes -- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
Best regards,
Jiri Prochazka LNST Developer | www.lnst-project.org
+420 532 294 633 | jprochaz@redhat.com Red Hat Czech | Purkyňova 71/99, 612 00 Brno
2015-09-09 10:39 GMT+02:00 Jiri Pirko jiri@resnulli.us:
Tue, Sep 08, 2015 at 04:20:35PM CEST, jprochaz@redhat.com wrote:
This patch introduces new style of versioning of LNST.
We will now use Major+minor style of versions, where major versions are based on major releases of our RPM packages and minor versions are only distinguished in devel GIT versions.
The version starts on 8.0
Each time a change is introduced, which may cause invalid behaviour when used with older version, developer should also increment minor version in this variable.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
NACK! I would like to at least discuss this first. Now, this does not make any sense to me.
We discussed it on thread "issue #136 RFC"
lnst/Common/Utils.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py index cb2272d..ea80a02 100644 --- a/lnst/Common/Utils.py +++ b/lnst/Common/Utils.py @@ -24,6 +24,8 @@ import math from _ast import Call, Attribute from lnst.Common.ExecCmd import exec_cmd
+LNST_VERSION = 8.0
def die_when_parent_die(): try: import ctypes -- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
scratch this patchset, as we found better solution to this
Best regards,
Jiri Prochazka LNST Developer | www.lnst-project.org
+420 532 294 633 | jprochaz@redhat.com Red Hat Czech | Purkyňova 71/99, 612 00 Brno
2015-09-09 16:14 GMT+02:00 Jiri Prochazka jprochaz@redhat.com:
Best regards,
Jiri Prochazka LNST Developer | www.lnst-project.org
+420 532 294 633 | jprochaz@redhat.com Red Hat Czech | Purkyňova 71/99, 612 00 Brno
2015-09-09 10:39 GMT+02:00 Jiri Pirko jiri@resnulli.us:
Tue, Sep 08, 2015 at 04:20:35PM CEST, jprochaz@redhat.com wrote:
This patch introduces new style of versioning of LNST.
We will now use Major+minor style of versions, where major versions are based on major releases of our RPM packages and minor versions are only distinguished in devel GIT versions.
The version starts on 8.0
Each time a change is introduced, which may cause invalid behaviour when used with older version, developer should also increment minor version in this variable.
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
NACK! I would like to at least discuss this first. Now, this does not make any sense to me.
We discussed it on thread "issue #136 RFC"
lnst/Common/Utils.py | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py index cb2272d..ea80a02 100644 --- a/lnst/Common/Utils.py +++ b/lnst/Common/Utils.py @@ -24,6 +24,8 @@ import math from _ast import Call, Attribute from lnst.Common.ExecCmd import exec_cmd
+LNST_VERSION = 8.0
def die_when_parent_die(): try: import ctypes -- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
lnst-developers@lists.fedorahosted.org