]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Make topotest working on different locale
authorMartin Winter <mwinter@opensourcerouting.org>
Fri, 20 Mar 2020 22:50:29 +0000 (23:50 +0100)
committerMartin Winter <mwinter@opensourcerouting.org>
Wed, 25 Mar 2020 21:36:27 +0000 (22:36 +0100)
"sort" as used in all-protocol-startup used sort which causes
different sort order based on locale settings. Specify the
correct one to make output matching our expected result

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
tests/topotests/all-protocol-startup/test_all_protocol_startup.py

index 9658c080c0c396a5f33ba1c34533db4943eff9ec..ea43ec7ef18421e83fe3eac3ca08f0fc18096f4c 100755 (executable)
@@ -306,7 +306,7 @@ def test_converge_protocols():
         expected = open(v4_routesFile).read().rstrip()
         expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
 
-        actual = net['r%s' %i].cmd('vtysh -c "show ip route" | /usr/bin/tail -n +7 | sort 2> /dev/null').rstrip()
+        actual = net['r%s' %i].cmd('vtysh -c "show ip route" | /usr/bin/tail -n +7 | env LC_ALL=en_US.UTF-8 sort 2> /dev/null').rstrip()
         # Drop time in last update
         actual = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", actual)
         actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)
@@ -328,7 +328,7 @@ def test_converge_protocols():
         expected = open(v6_routesFile).read().rstrip()
         expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
 
-        actual = net['r%s' %i].cmd('vtysh -c "show ipv6 route" | /usr/bin/tail -n +7 | sort 2> /dev/null').rstrip()
+        actual = net['r%s' %i].cmd('vtysh -c "show ipv6 route" | /usr/bin/tail -n +7 | env LC_ALL=en_US.UTF-8 sort 2> /dev/null').rstrip()
         # Drop time in last update
         actual = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", actual)
         actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)