From 2057c6ace484857cd7e57644d798636b5fe2d378 Mon Sep 17 00:00:00 2001 From: Dan Rue Date: Wed, 28 Jun 2017 13:18:45 -0500 Subject: Move to production squad reporting - Change how squad urls and tokens are stored to support staging and prod - Make run_erp_squad.sh a template so that we can replace the squad url according to squad_environment, rather than adding another command line argument - Change project name from 'debian' (default) to 'staging-debian'. Hard coded for now, but later if/when we want to support "release" testing, we can make it conditional. - In hosts, added a host group so that run.sh can run against a group of hosts Change-Id: I03343e1d2d45c25e4457855010724af9899ec304 Signed-off-by: Dan Rue --- erp-playbook/files/run_erp_suite.sh | 39 --------------- erp-playbook/group_vars/all | 60 ++++++++++++---------- erp-playbook/hosts | 88 ++++++++++++++++++--------------- erp-playbook/main.yml | 8 ++- erp-playbook/templates/run_erp_suite.sh | 40 +++++++++++++++ 5 files changed, 128 insertions(+), 107 deletions(-) delete mode 100644 erp-playbook/files/run_erp_suite.sh create mode 100644 erp-playbook/templates/run_erp_suite.sh diff --git a/erp-playbook/files/run_erp_suite.sh b/erp-playbook/files/run_erp_suite.sh deleted file mode 100644 index b54958f..0000000 --- a/erp-playbook/files/run_erp_suite.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -if [ -z $1 ]; then - echo "Usage: $0 " - exit 1 -fi - -report_url="https://staging-qa-reports.linaro.org" -plans="plans/rpb_ee/rpb_ee_functional.yaml plans/rpb_ee/rpb_ee_enterprise.yaml plans/rpb_ee/rpb_ee_performance.yaml plans/rpb_ee/rpb_ee_ltp.yaml" - -root_path=/root -td_path=${root_path}/test-definitions - -# Gather environmental info for erp project and environment names -vendor_name=$(slugify `cat /sys/devices/virtual/dmi/id/board_vendor`) -board_name=$(slugify `cat /sys/devices/virtual/dmi/id/board_name`) -os_name=$(slugify `grep ^ID= /etc/os-release | awk -F= '{print $2}'`) - -cd ${td_path} -. ./automated/bin/setenv.sh -build_id=$1-$(dpkg-query -W -f '${package}-${version}\n' | grep linaro | md5sum | cut -c -8) - -for plan in ${plans}; do - plan_short=$(basename -s .yaml ${plan}) - output_path=${root_path}/${build_id}-${plan_short} - mkdir -p ${output_path} - test-runner -o ${output_path} \ - -p ${plan} \ - > ${output_path}/test-runner-stdout.log \ - 2> ${output_path}/test-runner-stderr.log - post-to-squad -r ${output_path}/result.json \ - -b ${build_id} \ - -a ${output_path}/result.csv \ - -a ${output_path}/test-runner-stdout.log \ - -a ${output_path}/test-runner-stderr.log \ - -u ${report_url} \ - -t erp-${vendor_name} \ - > ${output_path}/post-to-squad.log 2>&1 -done diff --git a/erp-playbook/group_vars/all b/erp-playbook/group_vars/all index d6204f6..f7934bf 100644 --- a/erp-playbook/group_vars/all +++ b/erp-playbook/group_vars/all @@ -1,26 +1,36 @@ $ANSIBLE_VAULT;1.1;AES256 -31623431393236366534353539626365633434373266393838303739346566623034653934343639 -3666653863636133653734633030326262376433336564390a376133323361303838643537633635 -34653737663639656463633466633436643339356337313533613230363439646637393232366332 -3364643638623932380a646630373063623335623565373837656266623530396565383461376466 -33386632636439613339393435633337373839656432306561303861383936393261353831663762 -32353634643861353335376262336234393436363638313430393539353933326437346262653832 -36633935313834346165373132323337373664613263376335336431316266643431343536613265 -30626533613933323938623866303935323666636338656665376564666333383035396639306235 -36613133323632656366666131356138613634356438363064363936333262323531303461323431 -64346439306464313035383639646537626330336236306662663562386131383364363438366430 -61623333653034333038636665646339333535393437643638323332333261343065373835396465 -61393065636233386165323535323162633034343639313035316534396436376338303138653062 -32303137336163646432656235303438333661646265323433323837666663643935393961333435 -30626266633139633437313165666437333936316634663662663566613730303939396232323636 -63353031393561653133373738653331386237333739656130633266636139333239653661663833 -63613539646465393038376538333965383532336565363636616539643132313364663938616335 -39643062333835303332646136383030643939393862613836306538393336383365356630623562 -31663332643234333363363132393764326132653437663031313730376334623063666435613861 -30383233313136303636306165613839373365633364623735363464623932313138633936383537 -33393133636133313163326432623361383630646163643336393861383834313463363335393130 -35623230356337313531633638373166323532373865656162653937316130323534363137353936 -30363466646561366338323535653939643462333365646131356235616432393831653461356131 -64393263396365653564653761336231303864653931303231646466656631643430623436356331 -32633437313238313235323138663966636362373762373636366663333966643332613265393632 -62613166303865383637303535663631373065626638366335326264663231323530 +65616530646134366630663835373033633064353533623664313363643131303166386432616633 +6166373066653736373431363462356234313536666436370a376639646264646131386138613031 +34623065306339373030656462396530303433393961383564336337356661326630646661373333 +6431653961336432660a343061623535633964653432353762346335343532653334363663323333 +62363066656563633239643661353139653339626632396565373830333339366433316436323365 +35636366623465356462333364303864396137666339343836343031646431346665316164663936 +61653661373166613731643961663965316363616665373137333135386333373531306661383636 +65316339353137363136646432343364636364613233623132393065366339333262353537393930 +37663563326630353661623462663536343433633565313965616430623532346161653238663265 +35363838343566303832383464643663383333356238633730363366636165313666313165633966 +32613462646539366563383263613236316538343162653032626266653734373265623632636565 +62366437613431316538633137623263326632383965316533393139663334306531363461353166 +35313562346430633734343034383065663533623932666139663039343163323233656265623334 +35373730353630643662386534633465303465626534306539663636633236346632636334343864 +32366639303661333936623232666462353733366436646465333231303765356134306339373837 +63393137643430363762316363363166386233393835646332646366663339343462376637656462 +36663833643833643532386333313136383233666661346162356261373531346631323463316530 +36386661666635353862616566386262393231386266353534666163636235323966316637356332 +62646633303066646239376232626536303830343534363464633638393138333038316632633237 +64633034363039636234636232373830346561653431313237316136633637393839393164313533 +62356136313563316234366661303534636330343362333863363535633361613739653339386532 +36396266343934653639393563303133366462666136626237613866336462316634396135333932 +63343865336163373434643130396239386466353964303334636436353434656135623335366163 +64663036336537353330653631323164333437353235386639333832633565303438303636346635 +62396262616333353137636534653339633333363039373233616433643534636434376435336338 +62613638363566323162343062666331356361666432336235393061333538383862636230326630 +34633663333035303430626137313463656464393934363962653734613239643134346137653031 +35323332313262363432353966636437383531353134633330613866386431386335346432616261 +39356430383234653834353234613366343035366239313639363434626661363833363831343466 +34626639616139313466386166613861366232356533653634633533383363313737313435396464 +35383664326134393464366530343165343831303738383264363238313031623939626238363366 +64653737616339303534623635653430383934636633373535653137623838386239626439666230 +61363130306333393164663335336331616637363463663330653231643834336134663065616233 +62653834636239376332336435616639633933326230313132313963323061356638363334376134 +333736313962613533373837303433626631 diff --git a/erp-playbook/hosts b/erp-playbook/hosts index 3aaa2c7..53831f1 100644 --- a/erp-playbook/hosts +++ b/erp-playbook/hosts @@ -1,42 +1,48 @@ $ANSIBLE_VAULT;1.1;AES256 -64353463633631383730386665323534396361663239386439636639336131306338306362393434 -3163303133623264653262346637666431653265616461340a376661633639663335306162316430 -33303532666261663165653266323962333763313230626633343565366666383563383439383632 -3033663165353938340a383635663837363533386339366431373466336164396563356564656463 -62393764633830643633343830653333663166666333376330646462393165643438663630353466 -33363932386230303839363662333532303166656362353331313939663038666361396435666531 -64393138326130333961383237616164623164313230643234383230386139366331366666393561 -64636236356663376539383934613664363339623565653834393065306561346231376431646338 -37623137306533653432303434646435643765663734303830386465656330393332333230316462 -61333464333230333636383436336661636562643166626432663931366532623761626631383262 -37393033383730663862356261663133643637616236376538616366323564313737373336396665 -31346533326335663266623739663030303132316461396139326131383534336661346662353265 -61653264653231303837636532363766366536316537666161376636373534303930633831613361 -36396661336266333339346164663530363031643364653466303363653465663634613932376463 -34343831633733623866326131383635306165373036383338616439663030316562623766653561 -62316131333338353566626465333430366332346466303937303131613031626265353565376339 -37393937356661363535343236356138336335303734383063386666653536383137306432326534 -32633262333831396432643636623831356138353530666565653137313835633130613262613932 -63316663343665323262333964616334393362303266376231373539663266626131303730623633 -31616461363633643261333362646463353736393532626364346534633930643132666365366566 -65333139613366386239326532366466663565366264623262383431616166613661316164636263 -34333364303237396262313061623632303538383438313338616136303139613337623032633965 -37636334383139383665623936383861626465626664386364313963376334346137336238386434 -39333636373762393066383230613636343561336263393236613865616533663665306439323933 -62383236366239346662363139633639653364366631353438623161636666363436656263646637 -66386334633130623162353237626531353763353934306136653264316630363564363762366265 -34303661373733343862393761613963373564623836363038636338303763383335356338313538 -36323361383361656465336538326161373962306230386332646266643139343539613039336234 -63613734383236666531313031323666393262303738646133643533626666356263393134336362 -34303736393833366531633135393931346238373966646232626263616432616366363462306532 -61383839373265313931393731633963313936666162393266323563343434623162363935633436 -32663637633461633566376632336331336637346132663433643065666165376165373064646433 -62643038636566323236313436343035653565623938303830653332653564333130656433623466 -35626162356563633063363131363534616139396237333834353439303439343736653937346133 -65303833633136346539656531326133323134326533323236613839386133306162313237643064 -38323732373335666338326165323132333836663934313336653332313838643262646437376662 -38613936306265323836623035316161383662336630373836366563366538623836353838333361 -36656539616239333137383731383731636261616630303134323034656434306263346332353639 -64646463306365313935353266323931623561663937393537363065623739643661353730346238 -61343463633061636437356363363063636635613234376432376134313735306430323033343563 -3938 +35666635663836313735346463633438346335393332373633623233383130373063383136356564 +6430623666396434616637363364376337626530343934630a336436396636326366313865663635 +37303763363539303865623236653235346633383539353939326436653864336634353937383863 +6633656463373936660a353066356331336630356638346435643338633136633636303135363431 +39356130383030313234643037666561363765393039626264383338626139326634386462626162 +66346538353963323035653461363564383665396662666634646464656266626164356336373563 +38376436333764396431646433316563303136343831633836633137643261393536303161666233 +36326630343461663666393963666265633364373065636333643131323437396539643763653337 +37636230363336653466303562666364363831626133346565313266376463393332643765323764 +30303833353031656133393965383262386433383564616430326130396664613032306434303166 +37326638653339326630326261343537343237373336663839306635333239656362643132333764 +34313362323238326330353632366239386538663538646265666232366161303939633164646636 +39303636643162356235373565323036653861616332666163303231343833333930663730666431 +38323538306534353762663333383861393338666461383833303231383232636335376632636661 +34373936653162383535316661343532656538633731646431313631316530353430626630353539 +38376336333731613834653036343533336337353563316564653434656266633739376665393630 +61383333663535663936336335656263666237323261333563356530616161646133636532626262 +66306134343033313139386436396435646435646566666566386339613764383738306664313233 +32623664633334373138316339313763326162313738376335393938643632363938323261356534 +39366363353230633031343963633563303431386238326338393439313437643737386130323065 +34353866393332666231656631313365313434646532343439636437383466323331643937386530 +66396232343432336464663036363861303364383261633633333837636533396632633434383533 +32633366353832363331303231353966383263623739383236393034363637376431346563333330 +63616539323933373163623533666437376537643234666561306231346165303961323033633237 +66343434333431343036373361353638396336303363633938313032633139666631663166653335 +34663433323832383364303863333365643564343139396431626361353666636439343065356634 +36623836363963356465353063393262333231353531323332393136326639623066666265663566 +38303362663033313865393433363436356537323438666539313163313764633861333365623965 +66653861393733636661326261666464373464623634353261306332646634373464663164643161 +66386434303631333839626562666263653832643739346439396130643831323830336632633865 +63306436643261376236336231623364643532636362353465666564343032353339336131343762 +34306139303337373439313062346533663538333366663033376534336136346563366138376338 +32653738383639663961623265633161393732386430326137353863623930623834386336346566 +33366235326663626139633733323930356538323436373761643035393730643966386531613234 +63393163323136643635393533363830656466396132666239343333346638613039626430313565 +63666364623330626632646538323539333032353263623265343437626533376165636231626437 +38313466663038346239353530613261653532393235366636343564333462313364616537626565 +66636265623031393235653766303766656265303033643835626139653162393565393632663838 +65343262313335643632393163353962653730333430353061626461363864356261363433323738 +36346137643665613663653166323062373138663530633931336530356166623331363335663236 +62613637666363626131326234333766346239353836343164393139366632393134663436616261 +30356339666233313332663262663335306264613464636264613562656539313137613737646162 +32646231316632323633353162393433323837626361323739386562373462366466613538306566 +31343964643233346432353139386266323862336261643532363936313339663033363461633135 +34333834383135653864393162363735336339373330623761393339363338383962323964333334 +39313531303861653631383537363663363338323862633935353439353166643563356661336664 +663264323163643761633937303731333036 diff --git a/erp-playbook/main.yml b/erp-playbook/main.yml index 480875c..1a1f093 100644 --- a/erp-playbook/main.yml +++ b/erp-playbook/main.yml @@ -2,6 +2,9 @@ - hosts: erp become: yes become_method: su + vars: + squad_environment: production + tasks: - name: Verify build_number is set assert: @@ -44,7 +47,7 @@ name: python-slugify - name: Copy test harness - copy: + template: src: run_erp_suite.sh dest: /root/run_erp_suite.sh mode: 0755 @@ -53,5 +56,6 @@ # daemon --name ensures only one runs at a time command: daemon --name=erp_suite --errlog=/root/run_erp_suite.stderr.log --dbglog=/root/run_erp_suite.stdout.log -- /root/run_erp_suite.sh {{build_number}} environment: - SQUAD_AUTH_TOKEN: "{{squad_auth_token}}" + SQUAD_AUTH_TOKEN: "{{squad[squad_environment]['auth_token']}}" + diff --git a/erp-playbook/templates/run_erp_suite.sh b/erp-playbook/templates/run_erp_suite.sh new file mode 100644 index 0000000..0580eca --- /dev/null +++ b/erp-playbook/templates/run_erp_suite.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +if [ -z $1 ]; then + echo "Usage: $0 " + exit 1 +fi + +report_url="{{squad[squad_environment]['url']}}" +plans="plans/rpb_ee/rpb_ee_functional.yaml plans/rpb_ee/rpb_ee_enterprise.yaml plans/rpb_ee/rpb_ee_performance.yaml plans/rpb_ee/rpb_ee_ltp.yaml" + +root_path=/root +td_path=${root_path}/test-definitions + +# Gather environmental info for erp project and environment names +vendor_name=$(slugify `cat /sys/devices/virtual/dmi/id/board_vendor`) +board_name=$(slugify `cat /sys/devices/virtual/dmi/id/board_name`) +os_name=$(slugify `grep ^ID= /etc/os-release | awk -F= '{print $2}'`) + +cd ${td_path} +. ./automated/bin/setenv.sh +build_id=$1-$(dpkg-query -W -f '${package}-${version}\n' | grep linaro | md5sum | cut -c -8) + +for plan in ${plans}; do + plan_short=$(basename -s .yaml ${plan}) + output_path=${root_path}/${build_id}-${plan_short} + mkdir -p ${output_path} + test-runner -o ${output_path} \ + -p ${plan} \ + > ${output_path}/test-runner-stdout.log \ + 2> ${output_path}/test-runner-stderr.log + post-to-squad -r ${output_path}/result.json \ + -b ${build_id} \ + -a ${output_path}/result.csv \ + -a ${output_path}/test-runner-stdout.log \ + -a ${output_path}/test-runner-stderr.log \ + -u ${report_url} \ + -t erp-${vendor_name} \ + -p staging-debian \ + > ${output_path}/post-to-squad.log 2>&1 +done -- cgit v1.2.3