Merge ~alextu/pc-enablement/+git/oem-scripts:trigger-by-cid into ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master

Proposed by Alex Tu
Status: Merged
Merged at revision: c2597d711745e7163c17d66b31497f575b0f90d0
Proposed branch: ~alextu/pc-enablement/+git/oem-scripts:trigger-by-cid
Merge into: ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master
Diff against target: 52 lines (+9/-4)
1 file modified
trigger-sanity3.sh (+9/-4)
Reviewer Review Type Date Requested Status
Cyrus Lien Approve
Dirk Su Approve
Yao Wei Pending
OEM Solutions Group: Engineers Pending
Review via email: mp+413710@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Tu (alextu) wrote (last edit ):

https://code.launchpad.net/~alextu/pc-enablement/+git/oem-scripts/+merge/413656

with this change you are able to trigger single machine it's CID.
e.g. trigger both CID 202012-28586 and all machine tagged with alex-test
./trigger-sanity3.sh --cid 202012-28586 -t alex-test --target_img "dell-bto-focal-fossa-next" --image_no "lastSuccessfulBuild" --plan pc-sanity-software-test --inj_recovery "true" --auto_create_bug_assignee "stanley31"

e.g. only trigger CID 202012-28586
./trigger-sanity3.sh --cid 202012-28586 --target_img "dell-bto-focal-fossa-next" --image_no "lastSuccessfulBuild" --plan pc-sanity-software-test --inj_recovery "true" --auto_create_bug_assignee "stanley31"

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
blame: .
badpkg: rules build failed with exit code 2
erroneous package: rules build failed with exit code 2

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-dd25ed1-in-linux-container-focal

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-20bbea4-in-linux-container-focal

Revision history for this message
Alex Tu (alextu) wrote :

test result:
$ ./trigger-sanity3.sh --cid 980000-40003 --target_img "dell-bto-focal-fossa-next" --image_no "lastSuccessfulBuild" --plan pc-sanity-software-test --inj_recovery "true" --auto_create_bug_assignee "stanley31"
trigger job sanity-3-testflinger-dummy-980000-40003-staging

# http://10.102.135.50:8080/job/sanity-3-testflinger-dummy-980000-40003-staging/5/ is triggered by then

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-07bf0ba-in-linux-container-focal

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-07bf0ba-in-linux-container-focal

Revision history for this message
Dirk Su (dirksu) wrote :

Usage help string use --CID, the real command is --cid, may need to make it consistent

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-2da475a-in-linux-container-focal

Revision history for this message
Dirk Su (dirksu) wrote :

LGTM

review: Approve
Revision history for this message
Cyrus Lien (cyruslien) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/trigger-sanity3.sh b/trigger-sanity3.sh
2index 6098b80..0469ceb 100755
3--- a/trigger-sanity3.sh
4+++ b/trigger-sanity3.sh
5@@ -24,7 +24,7 @@ usage() {
6 cat << EOF
7 Usage:
8 $(basename "$0") -t <TAG> --dry-run
9-$(basename "$0") -t <TAG> -p <PROJECT> -u <USER> -k <API_TOKEN>
10+$(basename "$0") [-t <TAG>| --cid <CID> ] -p <PROJECT> -u <USER> -k <API_TOKEN>
11 [--exclude_task <TASK_TO_EXCLUDE>]
12 [--target_img <TARGET_IMAGE>]
13 [--image_no <IMAGE_NO>]
14@@ -38,6 +38,7 @@ Options:
15 -p|--project Project name, default is dummy
16 -u|--user Jenkins server username
17 -k|--token Jenkins server user API token
18+ --cid The CID that you would like to run sanity-3, ex: 202012-28586
19 --exclude_task sanity-3 parameter exclude_task
20 --target_img sanity-3 parameter target_image
21 (e.g. pc-stella-cmit-focal-amd64)
22@@ -75,7 +76,8 @@ trigger_sanity_3() {
23 local silent
24 [ "$verbose" -eq 0 ] && silent="-s"
25 #get mapping of tag to skus
26- skus=$(curl ${silent} http://"$HIC_ADDR"/q?db=tag | jq -r --arg TAG "$tag" 'with_entries(select(.value | startswith($TAG))) | keys | @sh' | tr -d \')
27+ [ -z "$tag" ] || skus=$(curl ${silent} http://"$HIC_ADDR"/q?db=tag | jq -r --arg TAG "$tag" 'with_entries(select(.value | startswith($TAG))) | keys | @sh' | tr -d \')
28+ [ -z "$CID" ] || skus="$skus $CID"
29
30 for i in $(seq 1 10); do
31 ONLINE_IPS=$(curl ${silent} http://"$HIC_ADDR"/q?db=ipo)
32@@ -176,6 +178,10 @@ main() {
33 shift
34 auto_create_bug_assignee="$1"
35 ;;
36+ --cid)
37+ shift
38+ CID=$1
39+ ;;
40 *)
41 echo "Not recognize $1"
42 usage
43@@ -184,8 +190,7 @@ main() {
44 shift
45 done
46 if [ -z "$tag" ];then
47- echo "Need to input tag"
48- usage
49+ [ -n "$CID" ] || (echo "Need to input tag or CID"; usage)
50 fi
51 if [ $dry_run -eq 0 ];then
52 if [ -z "$user" ];then

Subscribers

People subscribed via source and target branches