Code review comment for ~ycheng-twn/checkbox-ng:0001_checkbox_cli_show

Revision history for this message
Yuan-Chen Cheng (ycheng-twn) wrote :

As the sample code provided use the value from obj.attr. Per previous
test and check, it does not have all the important fields I'd like to
see in the output for job template.

Ex: (With the code provided)

$ /usr/local/bin/checkbox-cli show com.canonical.certification::wireless/wowlan_S5_{interface}_wakeonlan
Using sideloaded provider: plainbox-provider-checkbox, version 0.65.0.dev0 from /var/tmp/checkbox-providers/plainbox-provider-checkbox
id: com.canonical.certification::wireless/wowlan_S5_{interface}_wakeonlan
partial_id: wireless/wowlan_S5_{interface}_wakeonlan
template_unit: job
template_resource: device
template_filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN'
template_imports: None
origin: /var/tmp/checkbox-providers/plainbox-provider-checkbox/units/wireless/wowlan.pxu:1-26

You can see that it miss certain important value like the command.

While the full comment for it is:

unit: template
template-resource: device
template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN'
id: wireless/wowlan_S5_{interface}_wakeonlan
_summary: Wake on Wireless LAN (WoWLAN) test from S5 - {interface} - wakeonlan
_purpose:
 Check that another system can wake up from S5 the SUT using WoWLAN function.
_steps:
 1. Ensure WoWLAN is enabled in BIOS.
 2. Initiate connection to an AP (using nmcli)
 3. Configure the device for WoWLAN, run the command:
    $ sudo iw phy phy0 wowlan enable magic-packet
 4. Press Enter for S5 (Soft Off).
 5. From another computer on the same network run the following command:
    $ wakeonlan {mac}
    If wakeonlan tool is not installed run:
    $ sudo apt install wakeonlan
 6. Resume Checkbox
_verification:
  Did the SUT wake up from S5?
plugin: user-interact-verify
command: poweroff
user: root
category_id: com.canonical.plainbox::wireless
estimated_duration: 120
flags: preserve-locale

If we use obj._impl._raw_data, it misses something that would be useful for job object.

That's why I think just using the exact content from the origin file, with it's
existing format and data order, which will be not only the best quality in general,
(formatting, order of fields) but also we have the shortest code needed to have a good output.

The other way is to make sure all data field exists in obj.attr, which need more code change if I see it correctly.

« Back to merge proposal