Move collectversions from ts-xen-build into Osstest::BuildSupport
PATCH v3 1/2 Move collectversions from ts-xen-build into Osstest::BuildSupport
I'm going to have a need for it elsewhere.
--- Osstest/BuildSupport.pm | 12 ++++++++++++ ts-xen-build | 13 +------------ 2 files changed, 13 insertions(+), 12 deletions(-)
Osstest/BuildSupport.pm +12 -0
@@ -42,6 +42,7 @@ BEGIN { xendist $xendist + collect_xen_built_versions submodulefixup submodule_have submodule_find
@@ -84,6 +85,17 @@ sub xendist () { ($ho, 'xendist', '', $r{"buildjob"}); } +sub collect_xen_built_versions () { + my $tools="$builddir/xen/tools"; + my $extras="$builddir/xen/extras"; + store_revision($ho, 'qemu', "$tools/ioemu-dir", 1); + store_revision($ho, 'qemu', "$tools/qemu-xen-traditional-dir", 1); + store_revision($ho, 'qemuu', "$tools/qemu-xen-dir", 1); + store_revision($ho, 'seabios', "$tools/firmware/seabios-dir", 1); + store_revision($ho, 'ovmf', "$tools/firmware/ovmf-dir", 1); + store_revision($ho, 'minios', "$extras/mini-os", 1); +} + #----- submodules ----- sub submodulefixup ($$$$) {
ts-xen-build +1 -12
@@ -151,17 +151,6 @@ END } } -sub collectversions () { - my $tools="$builddir/xen/tools"; - my $extras="$builddir/xen/extras"; - store_revision($ho, 'qemu', "$tools/ioemu-dir", 1); - store_revision($ho, 'qemu', "$tools/qemu-xen-traditional-dir", 1); - store_revision($ho, 'qemuu', "$tools/qemu-xen-dir", 1); - store_revision($ho, 'seabios', "$tools/firmware/seabios-dir", 1); - store_revision($ho, 'ovmf', "$tools/firmware/ovmf-dir", 1); - store_revision($ho, 'minios', "$extras/mini-os", 1); -} - sub divide () { # Only move hv to xeninstall, so that we can have # xenpolicy in tools tarball.
@@ -248,7 +237,7 @@ sub trapping ($) { checkout(); trapping(\&build); -trapping(\&collectversions); +trapping(\&collect_xen_built_versions); die "*** something failed:\n\n".(join "\n\n",@probs)."\n** something failed" if @probs;
Signature · 1 line
2.6.1
PATCH v3 2/2 Add a weekly coverity flight
This primarily consists of ts-coverity-{build,upload} and make-coverity-flight which constructs the sole job.
The branch is named "xen-unstable-coverity" which matches various xen* in the cr-* scripts. Places which needed special treatement are handled by matching xen-*-coverity, which leaves the possibility of xen-4.7-testing-coverity etc in the future, but note that care would be needed so that coverity's tracking of new vs existing issues would likely be confused by uploading different branches without differentiating somehow (I don't know how this is supposed to work).
The most recently scanned revision is pushed to a new coverity-scanned/master branch in the usual xen.git, tests are run on the master branch.
I initially thoughts that $c{CoverityEmail} would need to be an actual account registered with scan, however a manual experiment using [email protected] was accepted by the service. An "analysis complete" message was sent to security@ while individual results mails were sent to each member of the coverity project who was configured to receive them. I think this is what we want. The "analysis complete" mail contained no sensitive data, but also no real information other than "success" (or presumably "failure" if that were to be the case). I think going to security@ is probably OK.
The upload URL defaults to a dummy local URL, which will fail (it would be possible in principal to put a stunt CGI there though). When run with "cr-daily-branch --real" (i.e. in full on production mode) then this is set instead to the value of CoverityUploadUrl from the config (production-config etc). This means that adhoc and play runs still exercise all the code (but the curl will fail) while --real runs upload to a site-configurable location. (Note that the URL includes the coverity project name, which would likely differ for different instances).
I have run this via cr-daily-branch --real on the production infra and it did upload as expected (flight 80516). Since master==coverity-tested/master at this point it came out as a baseline test which didn't attempt ap-push, which I would have expected to fail anyway since it was running as my user in the colo which cannot push to osstest@xenbits.
In my experiments the curl command took ~35 minutes to complete (rate in the 100-200k range). Not sure if this is a problem, but use curl --max-time passing it an hour to bound things. Note that curl is run on the controller (via system_checked). timeout etc.
Note that the token must be supplied with </path/to/token and not @/path/to/token. The latter appears to the server as a file upload rather than a text field in a form which doesn't work. In early attempts I thought that the trailing \n in /path/to/token might be an issue and hence wrote a big comment. However having discovered < vs @ I am no longer 100% sure that is the case, but I left the comment anyway since I can observe on the wire that the \n is included in the upload (but each test takes ~35 mins and there is a ratelimit on the server side too).
A final niggle is that the descripton field in the web ui ends up as:
80516:\ git://xenbits.xen.org/xen.git\ 9937763265d9597e5f2439249b16d995842cdf0
(i.e. spaces are \ escaped). I've confirmed with curl --trace-ascii the the uploaded data is not escaped (this is from an earlier attempt which did not include the flight number):
009a: Content-Disposition: form-data; name="description" 00ce:
00d0: git://xenbits.xen.org/xen.git 9937763265d9597e5f2439249b16d99584 0110: 2cdf0f
Due to the limitations on the numbers of uploads I've not experimented with possible fixes yet (e.g. URL escaping the upload). Worst case we either live with it or adjust the syntax to avoid the problematic characters.
---
v2:
- Split move of collect_xen_built_versions() into separate patch
- Implemented support for coverity_upload = true (but don't yet set it)
- Add host_hostflags to the job so it can actually run somewhere.
- Call tsreadconfig() before referencing $r{coverity_upload} so that $r is actually populated.
- use token=</path/to/token not token=@/path/to/token in curl arguments.
- CoverityEmail == [email protected] seems to work fine.
- Add $flight to description.
v3:
- Use curl --max-time.
- rename branch xen-unstable-coverity, allows switch from REVISION_COVERITY to REVISION_XEN which is more natureal as well as reducing the number of special cases needed. Also allows for the possibility xen-$other-coverity in the future if we desire (and there is scan bandwidth)
- Control upload URL via daily-cron-setting-real and provide a dummy default, drop the "upload" runvar. This means that patch #3 "make-coverity-flight: set coverity_upload=true" is no dropped.
- Split into build and upload tests (but only a single job), needed to stash "built_version_xen" and "path_coverity" in runvars.
- Don't install curl in ts-xen-build-prep, curl has been run on the controller for several revisions now (due to the need for the $c{CoverityToken} file).
- Use "curl --fail" so 404 etc turn into actual failures
Deployment notes:
- Put cov-analysis-linux64-7.7.0.4.tar.gz in the Images directory. DONE in COLO
- Populate $HOME/.xen-osstest/coverity-secret with the token DONE in COLO
- Push baseline to coverity-tested/master DONE
--- ap-fetch-version | 3 ++ ap-fetch-version-old | 3 ++ ap-push | 4 +++ cr-daily-branch | 1 + cri-common | 2 ++ crontab | 1 + daily-cron-settings-real | 2 ++ make-coverity-flight | 56 +++++++++++++++++++++++++++++++++ production-config | 7 +++++ sg-run-job | 6 ++++ ts-coverity-build | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ ts-coverity-upload | 54 ++++++++++++++++++++++++++++++++ 12 files changed, 220 insertions(+) create mode 100755 make-coverity-flight create mode 100755 ts-coverity-build create mode 100755 ts-coverity-upload
ap-fetch-version +3 -0
@@ -53,6 +53,9 @@ xen-4.*-testing) repo_tree_rev_fetch_git xen \ $TREE_XEN staging-$branchcore $LOCALREV_XEN ;; +xen-unstable-coverity) + repo_tree_rev_fetch_git xen $TREE_XEN master $LOCALREV_XEN + ;; qemu-mainline) repo_tree_rev_fetch_git $branch \ $TREE_QEMU_MAINLINE master $LOCALREV_QEMU_UPSTREAM
ap-fetch-version-old +3 -0
@@ -59,6 +59,9 @@ xen-4.*-testing) repo_tree_rev_fetch_git xen \ $TREE_XEN stable-$branchcore $LOCALREV_XEN ;; +xen-unstable-coverity) + repo_tree_rev_fetch_git xen $TREE_XEN coverity-tested/master $LOCALREV_XEN + ;; qemu-mainline) repo_tree_rev_fetch_git $branch \ $BASE_TREE_QEMU_UPSTREAM upstream-tested $LOCALREV_QEMU_UPSTREAM
ap-push +4 -0
@@ -68,6 +68,10 @@ xen-*-testing) xenversion=${xenversion#xen-} git push $TREE_XEN $revision:refs/heads/stable-$xenversion ;; +xen-unstable-coverity) + cd $repos/xen + git push $TREE_XEN $revision:refs/heads/coverity-tested/master + ;; qemu-mainline) cd $repos/qemu-mainline git push $TREE_QEMU_UPSTREAM $revision:refs/heads/upstream-tested
cr-daily-branch +1 -0
@@ -259,6 +259,7 @@ fi case $branch in distros-*) makeflight=./make-distros-flight ;; +xen-*-coverity)makeflight=./make-coverity-flight ;; *) makeflight=./make-flight ;; esac
cri-common +2 -0
@@ -67,6 +67,8 @@ select_prevxenbranch () { select_xenbranch () { case "$branch" in xen-unstable-smoke) tree=xen; xenbranch=$branch; qemuubranch=qemu-upstream-unstable;; + xen-*-coverity) tree=xen; xenbranch=$branch; qemuubranch=qemu-upstream-${branch#xen-} + qemuubranch=${qemuubranch%-coverity};; xen-*) tree=xen; xenbranch=$branch ;; qemu-mainline) tree=qemuu; xenbranch=xen-unstable; qemuubranch=qemu-mainline;; qemu-upstream-*) tree=qemuu; xenbranch=xen-${branch#qemu-upstream-};;
crontab +1 -0
@@ -8,6 +8,7 @@ [email protected],[email protected] 0 * * * * cd testing.git && BRANCHES=xen-unstable-smoke ./cr-for-branches branches -q "./cr-daily-branch --real" 4-59/30 * * * * cd testing.git && ./cr-for-branches branches -q "./cr-daily-branch --real" 18 9 * * 1,3,5 cd testing.git && BRANCHES=linux-next ./cr-for-branches branches -w "./cr-daily-branch --real" +18 9 * * 7 cd testing.git && BRANCHES=xen-unstable-coverity ./cr-for-branches branches -w "./cr-daily-branch --real" 18 4 * * * cd testing.git && BRANCHES='linux-linus linux-mingo-tip-master linux-3.0 libvirt rumpuserxen' ./cr-for-branches branches -w "./cr-daily-branch --real" 6-59/15 * * * * cd testing.git && EXTRA_BRANCHES='linux-linus linux-3.0 rumpuserxen libvirt' ./cr-for-branches bisects -w "./cr-try-bisect --real" #8-59/5 * * * * cd bisects/adhoc.git && with-lock-ex -q data-tree-lock bash -c "./cr-try-bisect-adhoc; exit $?"
daily-cron-settings-real +2 -0
@@ -1,2 +1,4 @@ : ${OSSTEST_HTML_SUBDIR:=results${OSSTEST_HTML_SUFFIX}} : ${OSSTEST_PUSH:=true} +: ${OSSTEST_COVERITY_URL:=`getconfig CoverityUploadUrl`} +export OSSTEST_COVERITY_URL
make-coverity-flight new file +56 -0
56 lines not on this page · raw message
production-config +7 -0
@@ -100,6 +100,13 @@ TftpGrubVersion XXXX-XX-XX XenUsePath /usr/groups/xencore/systems/bin/xenuse XenUseUser osstest +# Results might include potential vulnerabilities. +CoverityEmail [email protected] +# This is only read from daily-cron-settings-real, everything else +# gets the default/dummy path +CoverityUploadUrl https://scan.coverity.com/builds?project=XenProject +CoverityTools cov-analysis-linux64-7.7.0.4.tar.gz + # We use the IP address because Citrix can't manage reliable nameservice #DebianMirrorHost debian.uk.xensource.com #DebianMirrorHost 10.80.16.196
sg-run-job +6 -0
@@ -445,6 +445,12 @@ proc prepare-build-host {} { run-ts . host-build-prep ts-xen-build-prep } +proc need-hosts/coverity {} { return BUILD } +proc run-job/coverity {} { + run-ts . = ts-coverity-build + host + run-ts . = ts-coverity-upload + host +} + #---------- main program ---------- jobdb::set-flight
ts-coverity-build new file +81 -0
81 lines not on this page · raw message
ts-coverity-upload new file +54 -0
54 lines not on this page · raw message
Signature · 1 line
2.6.1
Re: [PATCH OSSTEST v3 2/2] Add a weekly coverity flight
Ian Campbell writes ("[PATCH OSSTEST v3 2/2] Add a weekly coverity flight"):
Quoted 2 lines
This primarily consists of ts-coverity-{build,upload} and make-coverity-flight which constructs the sole job.
Thanks!
Ian.