Move collectversions from ts-xen-build into Osstest::BuildSupport
PATCH 1/3 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 2/3 Add a weekly coverity flight
This primarily consists of ts-coverity-scan and make-coverity-flight which constructs the sole job.
The most recently scanned revision is pushed to a new coverity-scanned branch in the usual xen.git, tests are run on the master branch.
For the cr-* integration we treat branch=coverity as a special case of tree=xen. I didn't think tree=coverity made much sense, and would probably reach tendrils into lots of other places (such as the invocations of check_tested).
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.
I have run this in non-uploading mode on the production infra and then run the curl manually, adjusting the CLI until it works and updated the script to match. I have not yet run in uploading mode but will do so once another upload is allowed by the service,
In my experiments the curl command took ~35 minutes to complete (rate in the 100-200k range). Not sure if this is a problem. Note that curl is run on the controller (via system_checked) and consequently has no 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).
---
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.
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
- Populate xen.git#coverity-scanned with an initial baseline, update ap-fetch-version-old to refer to it instead of master.
--- ap-fetch-version | 3 ++ ap-fetch-version-old | 4 ++ ap-print-url | 2 +- ap-push | 4 ++ cr-daily-branch | 18 ++++++++- cri-common | 1 + crontab | 1 + make-coverity-flight | 52 ++++++++++++++++++++++++ production-config | 4 ++ sg-run-job | 5 +++ ts-coverity-scan | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++ ts-xen-build-prep | 2 +- 12 files changed, 203 insertions(+), 3 deletions(-) create mode 100755 make-coverity-flight create mode 100755 ts-coverity-scan
ap-fetch-version +3 -0
@@ -53,6 +53,9 @@ xen-4.*-testing) repo_tree_rev_fetch_git xen \ $TREE_XEN staging-$branchcore $LOCALREV_XEN ;; +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 +4 -0
@@ -59,6 +59,10 @@ xen-4.*-testing) repo_tree_rev_fetch_git xen \ $TREE_XEN stable-$branchcore $LOCALREV_XEN ;; +coverity) + #XXX doesn't exist yet, use master for now repo_tree_rev_fetch_git xen $TREE_XEN coverity-scanned $LOCALREV_XEN + repo_tree_rev_fetch_git xen $TREE_XEN master $LOCALREV_XEN + ;; qemu-mainline) repo_tree_rev_fetch_git $branch \ $BASE_TREE_QEMU_UPSTREAM upstream-tested $LOCALREV_QEMU_UPSTREAM
ap-print-url +1 -1
@@ -31,7 +31,7 @@ if info_linux_tree "$branch"; then fi case "$branch" in -xen-*) +xen-*|coverity) echo $TREE_XEN ;; qemu-mainline)
ap-push +4 -0
@@ -68,6 +68,10 @@ xen-*-testing) xenversion=${xenversion#xen-} git push $TREE_XEN $revision:refs/heads/stable-$xenversion ;; +coverity) + cd $repos/xen + git push $TREE_XEN $revision:refs/heads/coverity-scanned + ;; qemu-mainline) cd $repos/qemu-mainline git push $TREE_QEMU_UPSTREAM $revision:refs/heads/upstream-tested
cr-daily-branch +17 -1
@@ -205,7 +205,22 @@ fi case "$tree" in xen) realtree=$xenbranch - NEW_REVISION=$REVISION_XEN + + case $branch in + coverity) + if [ "x$TREE_COVERITY" = x ]; then + export TREE_COVERITY=$TREE_XEN + fi + if [ "x$REVISION_COVERITY" = x ]; then + determine_version REVISION_COVERITY coverity COVERITY + export REVISION_COVERITY + fi + NEW_REVISION=$REVISION_COVERITY + ;; + *) + NEW_REVISION=$REVISION_XEN + ;; + esac ;; linux) realtree=linux
@@ -259,6 +274,7 @@ fi case $branch in distros-*) makeflight=./make-distros-flight ;; +coverity) makeflight=./make-coverity-flight ;; *) makeflight=./make-flight ;; esac
cri-common +1 -0
@@ -68,6 +68,7 @@ select_xenbranch () { case "$branch" in xen-unstable-smoke) tree=xen; xenbranch=$branch; qemuubranch=qemu-upstream-unstable;; xen-*) tree=xen; xenbranch=$branch ;; + coverity) tree=xen; xenbranch=xen-unstable ;; qemu-mainline) tree=qemuu; xenbranch=xen-unstable; qemuubranch=qemu-mainline;; qemu-upstream-*) tree=qemuu; xenbranch=xen-${branch#qemu-upstream-};; linux) tree=linux; xenbranch=xen-unstable ;;
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=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 $?"
make-coverity-flight new file +52 -0
52 lines not on this page · raw message
production-config +4 -0
@@ -100,6 +100,10 @@ TftpGrubVersion XXXX-XX-XX XenUsePath /usr/groups/xencore/systems/bin/xenuse XenUseUser osstest +# Results might include potential vulnerabilities. +CoverityEmail [email protected] +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 +5 -0
@@ -445,6 +445,11 @@ 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-scan + host +} + #---------- main program ---------- jobdb::set-flight
ts-coverity-scan new file +110 -0
110 lines not on this page · raw message
ts-xen-build-prep +1 -1
@@ -206,7 +206,7 @@ sub prep () { autoconf automake libtool xsltproc libxml2-utils libxml2-dev libdevmapper-dev w3c-dtd-xhtml libxml-xpath-perl - ccache nasm checkpolicy ebtables); + ccache nasm checkpolicy ebtables curl); if ($ho->{Suite} =~ m/wheezy|squeeze|lenny/) { push(@packages, "libnl-dev");
Signature · 1 line
2.6.1
PATCH 3/3 make-coverity-flight: set coverity_upload=true
---
Apply once the previous patch + manual upload lead to us being happy.
--- make-coverity-flight | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
make-coverity-flight +1 -1
@@ -41,7 +41,7 @@ build_hostflags=share-build-$suite-$arch,arch-$arch,suite-$suite,purpose-build arch=$arch host_hostflags=$build_hostflags \ tree_xen=$TREE_COVERITY \ revision_xen=$REVISION_COVERITY \ - coverity_upload=false + coverity_upload=true echo $flight
Signature · 1 line
2.6.1
On Wed, 2016-02-03 at 09:46 +0000, Ian Campbell wrote:
These 3 should all have been tagged "OSSTEST v2", sorry for the omission.
Quoted 66 lines
I'm going to have a need for it elsewhere.
Signed-off-by Ian Campbell <[email protected]>---
Osstest/BuildSupport.pm | 12 ++++++++++++
ts-xen-build | 13 +------------2 files changed, 13 insertions(+), 12 deletions(-)Osstest/BuildSupport.pm +0
-0@@ -42,6 +42,7 @@ BEGIN {
xendist
$xendist
+ collect_xen_built_versions
submodulefixupsubmodule_havesubmodule_findOsstest/BuildSupport.pm +0
-0@@ -84,6 +85,17 @@ sub xendist () { ($ho, 'xendist', '', $r{"buildjob"}); }Osstest/BuildSupport.pm +11
-0+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 +0
-0@@ -151,17 +151,6 @@ END } }ts-xen-build +0
-11-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.ts-xen-build +0
-0@@ -248,7 +237,7 @@ sub trapping ($) { checkout();
trapping(\&build);ts-xen-build +1
-1-trapping(\&collectversions); +trapping(\&collect_xen_built_versions);
Quoted 4 lines
die "*** something failed:\n\n".(join "\n\n",@probs)."\n** something failed"
if @probs;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH 2/3] Add a weekly coverity flight
In reply to Ian CampbellQuoted 9 lines · Ian Campbell
[...]
ts-coverity-scan new file +8
-0+sub build () { + my $make = "make $makeflags"; + + # Pre build things we don't want coverity to scan, but which are + # normally built by some other command. + target_cmd_build($ho, 1000, $builddir, <<END); +cd $builddir/xen +./configure
ts-coverity-scan line 74
Quoted 10 lines
ts-coverity-scan new file +10
-0+$make -C tools/firmware/etherboot all +$make mini-os-dir +END + + # Now the stuff we want coverity to look at + target_cmd_build($ho, 9000, $builddir, <<END); +cd $builddir/xen +export PATH=$builddir/covtools/bin:\$PATH +cov-build --dir cov-int $make -C extras/mini-os/ +cov-build --dir cov-int $make xen tools
This omits building stubdom, which Andy's original script also did.
However stubdom exists as a category in the scan webui and there have previously been results for stubdoms.
Andy, I presume you deliberately started excluding stubdoms at some point? I think this is probably the right thing to do, at least for now, since stubdoms run with guest privileges so aren't hugely interesting, plus they include an awful lot of third party code which we don't want to be scanning+triaging (especially given how out of date some of the code is).
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH 2/3] Add a weekly coverity flight
Quoted 22 lines · Ian Campbell
Quoted 9 lines · Ian Campbell
[...]
ts-coverity-scan new file +8
-0+sub build () { + my $make = "make $makeflags"; + + # Pre build things we don't want coverity to scan, but which are + # normally built by some other command. + target_cmd_build($ho, 1000, $builddir, <<END); +cd $builddir/xen +./configurets-coverity-scan line 74
Quoted 10 lines
ts-coverity-scan new file +10
-0+$make -C tools/firmware/etherboot all +$make mini-os-dir +END + + # Now the stuff we want coverity to look at + target_cmd_build($ho, 9000, $builddir, <<END); +cd $builddir/xen +export PATH=$builddir/covtools/bin:\$PATH +cov-build --dir cov-int $make -C extras/mini-os/ +cov-build --dir cov-int $make xen toolsThis omits building stubdom, which Andy's original script also did.
Quoted 8 lines
However stubdom exists as a category in the scan webui and there have previously been results for stubdoms.
Andy, I presume you deliberately started excluding stubdoms at some point? I think this is probably the right thing to do, at least for now, since stubdoms run with guest privileges so aren't hugely interesting, plus they include an awful lot of third party code which we don't want to be scanning+triaging (especially given how out of date some of the code is).
Correct. That is precisely why I prevented stubdom and etherboot from being scanned.
~Andrew
Ian Campbell writes ("[PATCH 1/3] Move collectversions from ts-xen-build into Osstest::BuildSupport"):
Quoted 1 line
I'm going to have a need for it elsewhere.
Re: [PATCH 2/3] Add a weekly coverity flight
In reply to Ian CampbellIan Campbell writes ("[PATCH 2/3] Add a weekly coverity flight"):
Quoted 4 lines
In my experiments the curl command took ~35 minutes to complete (rate in the 100-200k range). Not sure if this is a problem. Note that curl is run on the controller (via
system_checked) and consequently has no timeout etc.
Can you use curl's builtin timeouts, or wrap it in alarm() ? Otherwise I think it is possible for this to become wedged indefinitely and need manual un-wedging.
AFAICT during the curl the only lock or resource which is held is the build host share. I think we can live with that.
Quoted 9 lines
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).
Right.
Quoted 7 lines
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
- Populate xen.git#coverity-scanned with an initial baseline, update ap-fetch-version-old to refer to it instead of master.
...
ap-fetch-version-old xen-4.*-testing) · line 63
Quoted 2 lines
ap-fetch-version-old +2
-0+coverity) + #XXX doesn't exist yet, use master for now repo_tree_rev_fetch_git xen $TREE_XEN coverity-scanned $LOCALREV_XEN
This XXX is out of date ? And so the code should be fixed ?
cr-daily-branch fi · line 218
Quoted 10 lines
cr-daily-branch +10
-0+ case $branch in + coverity) + if [ "x$TREE_COVERITY" = x ]; then + export TREE_COVERITY=$TREE_XEN + fi + if [ "x$REVISION_COVERITY" = x ]; then + determine_version REVISION_COVERITY coverity COVERITY + export REVISION_COVERITY + fi + NEW_REVISION=$REVISION_COVERITY
I'm not sure why these variables are all REVISION_COVERITY rather than REVISION_XEN.
But in general this looks good.
Ian.
Re: [PATCH 3/3] make-coverity-flight: set coverity_upload=true
In reply to Ian CampbellIan Campbell writes ("[PATCH 3/3] make-coverity-flight: set coverity_upload=true"):
Quoted 3 lines
Signed-off-by Ian Campbell <[email protected]>---
Apply once the previous patch + manual upload lead to us being happy.
I'll ack this at that time. Obviously there's nothing to review :-).
Ian.
Re: [PATCH 2/3] Add a weekly coverity flight
In reply to Andrew CooperAndrew Cooper writes ("Re: [PATCH 2/3] Add a weekly coverity flight"):
Quoted 9 lines · Ian Campbell
Quoted 5 lines
Andy, I presume you deliberately started excluding stubdoms at some point? I think this is probably the right thing to do, at least for now, since stubdoms run with guest privileges so aren't hugely interesting, plus they include an awful lot of third party code which we don't want to be scanning+triaging (especially given how out of date some of the code is).
Correct. That is precisely why I prevented stubdom and etherboot from being scanned.
I agree with this reasoning.
Ian.
Re: [PATCH 2/3] Add a weekly coverity flight
In reply to Ian JacksonQuoted 9 lines · Ian Jackson
Ian Campbell writes ("[PATCH 2/3] Add a weekly coverity flight"):
Quoted 4 lines
In my experiments the curl command took ~35 minutes to complete (rate in the 100-200k range). Not sure if this is a problem. Note that curl is run on the controller (via
system_checked) and consequently has no timeout etc.Can you use curl's builtin timeouts, or wrap it in
alarm()? Otherwise I think it is possible for this to become wedged indefinitely and need manual un-wedging.
I added --max-time 3600.
Quoted 2 lines
AFAICT during the curl the only lock or resource which is held is the build host share. I think we can live with that.
There's the per-branch lock too, FWIW.
Quoted 7 lines
Quoted 7 lines
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
- Populate xen.git#coverity-scanned with an initial baseline, update ap-fetch-version-old to refer to it instead of master.
Quoted 6 lines
...
Quoted 3 lines
(quoted diff) +2
-0+coverity) + #XXX doesn't exist yet, use master for now
repo_tree_rev_fetch_gitxen $TREE_XEN coverity-scanned $LOCALREV_XENThis XXX is out of date ? And so the code should be fixed ?
coverity-scanned doesn't exist in xen.git yet, so for now this is still correct, its the subject of the 3rd deployment note.
I'd be happy to push 9937763265d9597e5f2439249b16d995842cdf0f (the subject of my recent adhoc test) to that new branch in xen.git right away though if you agree and then update this code.
Quoted 6 lines
Quoted 6 lines
cr-daily-branch +6
-0+ case $branch in + coverity) + if [ "x$TREE_COVERITY" = x ]; then + export TREE_COVERITY=$TREE_XEN + fi + if [ "x$REVISION_COVERITY" = x ]; then
Quoted 8 lines
cr-daily-branch fi · line 218
Quoted 5 lines
(quoted diff) +1
-0+ determine_version REVISION_COVERITY coverityCOVERITY
cr-daily-branch +3
-0+ export REVISION_COVERITY + fi + NEW_REVISION=$REVISION_COVERITYI'm not sure why these variables are all
REVISION_COVERITYrather thanREVISION_XEN.
IIRC I had trouble getting cr-daily-branch's determine_version to populate REVISION_XEN using values from "ap-fetch-version* coverity", maybe due to the [ "x$tbranch" = "x$branch" ] ?
or else there was some other wrinkle around that area.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel