Merge ~jocave/plainbox-provider-snappy:netplan-wireless-fixes into plainbox-provider-snappy:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: 6f1066bc0f63c835ec67152d7e2bcc79877d0829
Merged at revision: bf436aa6a77fb209cd389d3d5f109f996a856cd5
Proposed branch: ~jocave/plainbox-provider-snappy:netplan-wireless-fixes
Merge into: plainbox-provider-snappy:master
Diff against target: 36 lines (+8/-3)
1 file modified
bin/wifi_client_test_netplan.py (+8/-3)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+368727@code.launchpad.net

Description of the change

It was spotted on some recent core18 beta test runs that there some tests were passed incorrectly.

This was because of the two bugs attached. A commit for each is included. Tested on an amd64 and rpi3 in the lab.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

minor: raise SystemExit(1) is probably better/more readable (we know we exit with system exit status 1)

Revision history for this message
Jonathan Cave (jocave) wrote :

Agreed, swapped the empty strings for return code 1

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Thanks, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/wifi_client_test_netplan.py b/bin/wifi_client_test_netplan.py
2index c3c0345..c99c861 100755
3--- a/bin/wifi_client_test_netplan.py
4+++ b/bin/wifi_client_test_netplan.py
5@@ -179,7 +179,12 @@ def delete_test_config():
6 def netplan_apply_config():
7 cmd = "netplan --debug apply"
8 print_cmd(cmd)
9- retcode = sp.call(cmd, shell=True)
10+ # Make sure the python env used by netplan is from the base snap
11+ env = os.environ
12+ env.pop('PYTHONHOME', None)
13+ env.pop('PYTHONPATH', None)
14+ env.pop('PYTHONUSERBASE', None)
15+ retcode = sp.call(cmd, shell=True, env=env)
16 if retcode != 0:
17 print("ERROR: failed netplan apply call")
18 return False
19@@ -252,7 +257,7 @@ def main():
20 if not netplan_apply_config():
21 delete_test_config()
22 netplan_config_restore()
23- raise SystemExit()
24+ raise SystemExit(1)
25 print()
26 time.sleep(20)
27
28@@ -271,7 +276,7 @@ def main():
29 raise SystemExit("ERROR: failed to apply restored config")
30
31 if not test_result:
32- raise SystemExit("")
33+ raise SystemExit(1)
34
35
36 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches