Message ID | 20240409202410.2644936-1-i.maximets@ovn.org |
---|---|
State | Accepted |
Commit | 10588fed098032ee1f8c02b203367d924f3a7f83 |
Delegated to: | Ilya Maximets |
Headers | show |
Series | [ovs-dev,branch-2.17] xenserver: Fix tests with Python 3.12. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
On Tue, Apr 09, 2024 at 10:24:09PM +0200, Ilya Maximets wrote: > Without this change many unit tests are failing on systems with > Python 3.12: > > +++ /tests/testsuite.dir/at-groups/2352/stdout > @@ -1,3 +1,5 @@ > +/./interface-reconfigure:98: SyntaxWarning: invalid escape sequence '\s' > + p = re.compile(".*\s%(MAC)s\s.*" % pifrec, re.IGNORECASE) > > Converting to a raw string to avoid the issue. > > This only affects OVS 2.17, support for XenServer was removed > in OVS 3.0. > > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Thanks Ilya, I confirmed that on Fedora 41, which has Python 3.12.2, the following tests fail without this patch and succeed with it. Or more to the point, all tests pass with this patch applied. 2353: VLAN, non-bond ok 2354: Bond, non-VLAN ok 2355: VLAN on bond ok 2352: non-VLAN, non-bond ok Acked-by: Simon Horman <horms@ovn.org> Tested-by: Simon Horman <horms@ovn.org>
On 4/10/24 18:17, Simon Horman wrote: > On Tue, Apr 09, 2024 at 10:24:09PM +0200, Ilya Maximets wrote: >> Without this change many unit tests are failing on systems with >> Python 3.12: >> >> +++ /tests/testsuite.dir/at-groups/2352/stdout >> @@ -1,3 +1,5 @@ >> +/./interface-reconfigure:98: SyntaxWarning: invalid escape sequence '\s' >> + p = re.compile(".*\s%(MAC)s\s.*" % pifrec, re.IGNORECASE) >> >> Converting to a raw string to avoid the issue. >> >> This only affects OVS 2.17, support for XenServer was removed >> in OVS 3.0. >> >> Signed-off-by: Ilya Maximets <i.maximets@ovn.org> > > Thanks Ilya, > > I confirmed that on Fedora 41, which has Python 3.12.2, > the following tests fail without this patch and succeed with it. > Or more to the point, all tests pass with this patch applied. > > 2353: VLAN, non-bond ok > 2354: Bond, non-VLAN ok > 2355: VLAN on bond ok > 2352: non-VLAN, non-bond ok > > Acked-by: Simon Horman <horms@ovn.org> > Tested-by: Simon Horman <horms@ovn.org> Thanks, Simon! Applied to branch-2.17. Best regards, Ilya Maximets.
diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index 9c20725de..49d208296 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -95,7 +95,7 @@ def check_allowed(pif): macline = filter(lambda x: x.startswith("HWaddr:"), f.readlines()) f.close() if len(macline) == 1: - p = re.compile(".*\s%(MAC)s\s.*" % pifrec, re.IGNORECASE) + p = re.compile(r".*\s%(MAC)s\s.*" % pifrec, re.IGNORECASE) if p.match(macline[0]): log("Skipping PVS device %(device)s (%(MAC)s)" % pifrec) return False
Without this change many unit tests are failing on systems with Python 3.12: +++ /tests/testsuite.dir/at-groups/2352/stdout @@ -1,3 +1,5 @@ +/./interface-reconfigure:98: SyntaxWarning: invalid escape sequence '\s' + p = re.compile(".*\s%(MAC)s\s.*" % pifrec, re.IGNORECASE) Converting to a raw string to avoid the issue. This only affects OVS 2.17, support for XenServer was removed in OVS 3.0. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- xenserver/opt_xensource_libexec_interface-reconfigure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)