-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,23 +36,16 @@ So the template structure will like this: | |
This script provide some arguments for generating the yaml file: | ||
<!-- markdownlint-configure-file { "MD013": { "line_length": 150 } } --> | ||
```text | ||
usage: testflinger_ymal_generator.py [-h] -c CID -o OUTPUTFILENAME | ||
[--outputFolder OUTPUTFOLDER] [--testplan TESTPLAN] | ||
[--excludeJobs EXCLUDEJOBS] [--checkboxType {deb,snap}] | ||
[--provisionType {distro,url}] | ||
[--provisionImage PROVISIONIMAGE] | ||
[--globalTimeout GLOBALTIMEOUT] | ||
[--outputTimeout OUTPUTTIMEOUT] | ||
[--sessionDesc SESSIONDESC] | ||
[--manifestJson MANIFESTJSON] | ||
[--LauncherTemplate LAUNCHERTEMPLATE] | ||
[--reserveTime RESERVETIME] | ||
[--TFYamlTemplate TFYAMLTEMPLATE] | ||
usage: testflinger_yaml_generator.py [-h] -c CID -o OUTPUTFILENAME [--outputFolder OUTPUTFOLDER] [--dist-upgrade] [--testplan TESTPLAN] [--excludeJobs EXCLUDEJOBS] | ||
Check failure on line 39 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 39 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 39 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
[--sessionDesc SESSIONDESC] [--checkboxType {deb,snap}] [--provisionType {distro,url}] [--provisionImage PROVISIONIMAGE] | ||
[--provisionToken PROVISIONTOKEN] [--provisionUserData PROVISIONUSERDATA] [--provisionAuthKeys PROVISIONAUTHKEYS] [--provisionOnly] | ||
Check failure on line 41 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 41 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 41 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
[--globalTimeout GLOBALTIMEOUT] [--outputTimeout OUTPUTTIMEOUT] [--manifestJson MANIFESTJSON] [--needManifest] [--no-needManifest] | ||
[--checkboxConf CHECKBOXCONF] [--LauncherTemplate LAUNCHERTEMPLATE] [--LpID LPID] [--reserveTime RESERVETIME] [--TFYamlTemplate TFYAMLTEMPLATE] | ||
Check failure on line 43 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 43 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 43 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
[--binFolder BINFOLDER] | ||
Testflinger yaml file generator | ||
Testflinger yaml file genertor | ||
optional arguments: | ||
options: | ||
-h, --help show this help message and exit | ||
Required: | ||
|
@@ -63,48 +56,53 @@ Required: | |
general options: | ||
--outputFolder OUTPUTFOLDER | ||
Set the output folder path (default: ./) | ||
--testplan TESTPLAN Set the checkbox test plan name. If didn't set this will not run | ||
checkbox test (default: ) | ||
--dist-upgrade Set to allow the dist-upgrade before run checkbox test (default: False) | ||
--testplan TESTPLAN Set the checkbox test plan name. If didn't set this will not run checkbox test (default: ) | ||
--excludeJobs EXCLUDEJOBS | ||
Set the exclude jobs pattern. ie".*memory/memory_stress_ng.*". | ||
(default: ) | ||
Set the exclude jobs pattern. ie".*memory/memory_stress_ng". (default: ) | ||
--sessionDesc SESSIONDESC | ||
Set the session description (default: CE-QA-PC_Test) | ||
--checkboxType {deb,snap} | ||
Set which checkbox type you need to install and test. (default: deb) | ||
--provisionType {distro,url} | ||
Set the provision type (default: distro) | ||
--provisionImage PROVISIONIMAGE | ||
The provision image. ie, desktop-22-04-2-uefi. If didn't set this | ||
mean no provision (default: ) | ||
The provision image. ie, desktop-22-04-2-uefi. If didn't set this mean no provision (default: ) | ||
--provisionToken PROVISIONTOKEN | ||
Optional file with username and token when image URL requires authentication (i.e Jenkins artifact). This file must be in YAML format, i.e: "username: | ||
Check failure on line 72 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 72 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 72 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
$JENKINS_USERNAME \n token: $JENKINS_API_TOKEN" (default: ) | ||
--provisionUserData PROVISIONUSERDATA | ||
user-data file for autoinstall and cloud-init provisioning. This argument is a MUST required if deploy the image using the autoinstall image (i.e. 24.04 image) | ||
Check failure on line 75 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 75 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 75 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
(default: ) | ||
--provisionAuthKeys PROVISIONAUTHKEYS | ||
ssh authorized_keys file to add in provisioned system (default: ) | ||
--provisionOnly Run only provisioning without tests. Removes test_data before generating the yaml. (default: False) | ||
--globalTimeout GLOBALTIMEOUT | ||
Set the testflinger's global timeout. Max:43200 (default: 43200) | ||
--outputTimeout OUTPUTTIMEOUT | ||
Set the output timeout if the DUT didn't response to server, it will | ||
be forced closed this job. It should be set under the global | ||
timeout. (default: 9000) | ||
Set the output timeout if the DUT didn't response to server, it will be forced closed this job. It should be set under the global timeout. (default: 9000) | ||
Check failure on line 83 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 83 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 83 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
Launcher settion options: | ||
--sessionDesc SESSIONDESC | ||
Set the session description (default: CE-QA-PC_Test) | ||
--manifestJson MANIFESTJSON | ||
Set the manifest json file to build the launcher. (default: | ||
./template/manifest.json) | ||
Set the manifest json file to build the launcher. (default: /home/isaacyang/Downloads/oem-qa-tools/Tools/PC/testflinger_yaml_generator/template/manifest.json) | ||
--needManifest Set if need the Manifest. (default: True) | ||
--no-needManifest | ||
--checkboxConf CHECKBOXCONF | ||
Set the checkbox configuration file to build the launcher. (default: /home/isaacyang/Downloads/oem-qa- | ||
tools/Tools/PC/testflinger_yaml_generator/template/checkbox.conf) | ||
--LauncherTemplate LAUNCHERTEMPLATE | ||
Set the launcher template folder (default: | ||
./template/launcher_config/) | ||
Set the launcher template folder (default: /home/isaacyang/Downloads/oem-qa-tools/Tools/PC/testflinger_yaml_generator/template/launcher_config/) | ||
Testflinger yaml options: | ||
--LpID LPID If you want to reserve the DUT, please input your Launchpad ID | ||
(default: ) | ||
--LpID LPID If you want to reserve the DUT, please input your Launchpad ID (default: ) | ||
--reserveTime RESERVETIME | ||
Set the timeout (sec) for reserve. (default: 1200) | ||
--TFYamlTemplate TFYAMLTEMPLATE | ||
Set the testflinger template yaml file (default: | ||
./template/template.yaml) | ||
Set the testflinger template yaml file (default: /home/isaacyang/Downloads/oem-qa-tools/Tools/PC/testflinger_yaml_generator/template/template.yaml) | ||
Test command in testflinger yaml: | ||
--binFolder BINFOLDER | ||
Set the testflinger test command folder. (default: | ||
./template/shell_scripts/) | ||
Set the testflinger test command folder (default: /home/isaacyang/Downloads/oem-qa-tools/Tools/PC/testflinger_yaml_generator/template/shell_scripts/) | ||
``` | ||
|
||
### Basically usage | ||
|
@@ -125,20 +123,47 @@ path | |
|
||
> `./testflinger_ymal_generator.py -c $CID -o $OUTPUT_YAML --LpID $LP_ID --testplan $TEST_PLAN --manifestJson $MANIFEST_JSON_PATH` | ||
1. If we only want to provision and w/o testcmd field | ||
|
||
> `./testflinger_yaml_generator.py -c $CID -o $OUTPUT_YAML --LpID $LP_ID --provisionImage $IMAGE_NAME --provisionOnly` | ||
## How do we do for testing (w/ provision) cert lab’s DUT w/ this script | ||
|
||
**Prepare:** CID, provision_image_name, manifest_json_file, test_plan_name. | ||
|
||
**Modify file:** `20_before_test` (if we want to add the staging ppa repo or | ||
something else), `99_end_test` (maybe copy some file in artifacts folder) | ||
|
||
|
||
Check failure on line 137 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Multiple consecutive blank lines
Check failure on line 137 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Multiple consecutive blank lines
Check failure on line 137 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Multiple consecutive blank lines
|
||
```sh | ||
git clone --depth 1 --branch main [email protected]:canonical/ce-oem-dut-checkbox-configuration.git | ||
# if `$CID` in `PC/` folder, we can use the `PC/$CID/manifest.json` as `$MANIFEST_JSON_PATH` | ||
# else we can use the `PC/default/manifest.json` or `./template/manifest.json` we modify by our self | ||
./testflinger_ymal_generator.py -c $CID -o $OUTPUT_YAML --LpID $LP_ID --testplan $TEST_PLAN --provisionImage $IMAGE_NAME --manifestJson $MANIFEST_JSON_PATH | ||
# if `$CID` in `PC/` folder, we can use the `PC/$CID/manifest.json` and `PC/$CID/checkbox.conf` | ||
# as `$MANIFEST_JSON_PATH` and `$CHECKBOX_CONF_PATH` | ||
# else we can use the `PC/default/manifest.json` `PC/default/checkbox.conf` or | ||
# `./template/manifest.json` `./template/checkbox.fonf` we modify by ourselves | ||
./testflinger_ymal_generator.py -c $CID -o $OUTPUT_YAML --LpID $LP_ID --testplan $TEST_PLAN --provisionImage $IMAGE_NAME --manifestJson $MANIFEST_JSON_PATH --checkboxConf $CHECKBOX_CONF_PATH | ||
Check failure on line 144 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
Check failure on line 144 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Line length
Check failure on line 144 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Line length
|
||
JOB_ID=$(testflinger-cli -q $OUTPUT_YAML) | ||
testflinger-cli poll $JOB_ID | ||
TEST_STATUS=$(testflinger results $JOB_ID |jq -r .test_status) | ||
testflinger artifacts $JOB_ID | ||
``` | ||
|
||
## How do we do for testing w/o provision for IOT deivce via this script | ||
|
||
**Prepare**: manifest_json_file, checkbox_conf ,test_plan_name, checkbox_snap_install_script. | ||
|
||
**Modify file:** `/template/shell_scripts/02_Install_checkbox_snap` (based | ||
Check failure on line 155 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Trailing spaces
Check failure on line 155 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Trailing spaces
Check failure on line 155 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Trailing spaces
|
||
on your checkbox snap install script and follow the original file structure). | ||
|
||
**Note:** If you don't have the launcher or checkbox_conf which combined with manifest. | ||
eg: | ||
Check failure on line 159 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Trailing spaces
Check failure on line 159 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-22.04)Trailing spaces
Check failure on line 159 in Tools/PC/testflinger_yaml_generator/readme.md GitHub Actions / build (ubuntu-20.04)Trailing spaces
|
||
```text | ||
[manifest] | ||
abc::123 = true | ||
[environment] | ||
zxc = 123 | ||
``` | ||
You can use like this | ||
`./testflinger_yaml_generator.py -c $CID --checkboxType snap --testplan $TEST_PLAN --no-needManifest --checkboxConf $CHECKBOX_CONF_WITH_MANIFEST` | ||
|