checkbox-ng no longer honoring system vars set in conf file

Bug #1560198 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Next Generation Checkbox (CLI)
Fix Released
Critical
Maciej Kisielewski

Bug Description

Fresh xenial install with a fresh install from the latest release to the public ppa:

checkbox-ng 0.24~ppa~ubuntu16.04.1
plainbox-provider-checkbox 0.26~ppa2~ubuntu16.04.1
python3-checkbox-ng 0.24~ppa~ubuntu16.04.1
python3-checkbox-support 0.24~ppa~ubuntu16.04.1
plainbox-insecure-policy 0.26~ppa~ubuntu16.04.1
plainbox-provider-certification-server 0.23-1
plainbox-provider-checkbox 0.26~ppa2~ubuntu16.04.1
plainbox-provider-resource-generic 0.24~ppa~ubuntu16.04.1
python3-plainbox 0.26~ppa~ubuntu16.04.1

the config file /etc/xdg/canonical-certification.conf is configured with the following for TEST_TARGET_IPERF:

# For network testing:
#
# TEST_TARGET_IPERF is the IP/Hostname of the iperf server for network testing.
#
# UNCOMMENT THE FOLLOWING LINE and set the proper parameters as necessary:
TEST_TARGET_IPERF = 10.0.0.1

However, when executing the 16.04 Network Only whitelist, I get the following:

ERROR:root:Target server has not been supplied.
INFO:root:Configuration settings can be configured 3 different ways:
INFO:root:1- If calling the script directly, pass the --target option
INFO:root:2- Define the TEST_TARGET_IPERF environment variable
INFO:root:3- (If running the test via checkbox/plainbox, define the
INFO:root:target in /etc/xdg/canonical-certification.conf)
INFO:root:Please run this script with -h to see more details on how to configure

Iperf3 IS running on the target, and I can manually run iperf3 client against the target with success.

I can also successfully run the script like this:
ubuntu@x-wing:~$ sudo TEST_TARGET_IPERF=10.0.0.1 /usr/lib/plainbox-provider-checkbox/bin/network test -i eth0 -t iperf --iperf3 --runtime 10
INFO:root:Starting iperf against 10.0.0.1, this could take a while...
INFO:root:Min Transfer speed: 938.0 Mb/s
INFO:root:Max Transfer speed: 959.0 Mb/s
INFO:root:Avg Transfer speed: 943.0 Mb/s
INFO:root:94.30% of theoretical max 1000 Mb/s
INFO:root:
INFO:root:CPU utilization: 3.0%
INFO:root:------------------ Finished run number 1 ------------------

So the script itself works, it's checkbox-ng that is no longer reading the env vars properly...

Related branches

Changed in checkbox-ng:
assignee: nobody → Maciej Kisielewski (kissiel)
Changed in checkbox-ng:
status: Confirmed → In Progress
Changed in checkbox-ng:
milestone: none → 0.25
status: In Progress → Fix Committed
Revision history for this message
Pierre Equoy (pieq) wrote :

It looks like this bug fix introduced a regression.

I'm not sure if it fixed Jeff's problem, but it messed up the OEM (and probably Cert) providers.

To reproduce:

1. Install Plainbox OEM providers (for instance the Stella ones)
2. Make sure the /etc/xdg/plainbox.conf file contains:

    ROUTERS = multiple

(it should also contain the SSID and password for the different Wireless networks you want to test, such as WPA_BG_SSID and WPA_BG_PSK for instance)

3. Run the Stella Full test plan using stella-cli
4. Select the Wireless tests only and start testing
→ All the tests are skipped because:

    resource expression "environment.ROUTERS == 'multiple'" evaluates to false

I noticed that if I alter stella-cli to add:

[environment]
ROUTERS = multiple

then the tests can be run but fail because I haven't added the other keys needed for those tests (WPA_BG_SSID and WPA_BG_PSK for instance)

Checkbox should load the configuration from:
- /etc/xdg/plainbox.conf
- /etc/xdg/canonical-certification.conf
- ~/.config/plainbox.conf
- ~/.config/canonical-certification.conf
- the [environment] section from the launcher itself

I guess the rule for superseding should be based on the list above in terms of priorities.

Changed in checkbox-ng:
status: Fix Committed → Confirmed
Revision history for this message
Pierre Equoy (pieq) wrote :

OK, thanks to Maciek's help, I understood what was going on.

With this code change, the new launchers will look by default for
    /etc/xdg/canonical-certification.conf

In order to override this, we simply need to add the following in our launchers:

[config]
config_filename = plainbox.conf

That way, checkbox will look for configuration customization in:
- /etc/xdg/plainbox.conf
- ~/.config/plainbox.conf
- and finally, in the [environment] section of the launcher itself

Pierre Equoy (pieq)
Changed in checkbox-ng:
status: Confirmed → Fix Committed
Pierre Equoy (pieq)
Changed in checkbox-ng:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.