Merge lp:~1chb1n/ubuntu-openstack-ci/artifact-move into lp:ubuntu-openstack-ci

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 337
Proposed branch: lp:~1chb1n/ubuntu-openstack-ci/artifact-move
Merge into: lp:ubuntu-openstack-ci
Diff against target: 714 lines (+272/-123)
19 files modified
.bzrignore (+1/-0)
admin/822-novarc-artifactweb-credentials-distribute.sh (+29/-0)
job-parts/build_amulet_smoke.sh (+13/-55)
job-parts/build_amulet_test.sh (+2/-1)
job-parts/build_bucket_junk_cleanup.sh (+1/-1)
job-parts/build_bucket_reset_object_headers.sh (+1/-1)
job-parts/build_bucket_update_indices.sh (+1/-1)
job-parts/build_charm_single.sh (+2/-2)
job-parts/build_maint_nodes.sh (+27/-0)
job-parts/build_mojo_runner.sh (+0/-1)
job-parts/build_osi.sh (+0/-1)
job-parts/osci_apt_common.sh (+56/-3)
job-parts/osci_gerrit_common.sh (+4/-10)
job-parts/osci_job_common.sh (+16/-1)
job-parts/osci_jujudevel_common.sh (+14/-4)
job-parts/osci_mojo_common.sh (+0/-16)
job-parts/osci_openstack_common.sh (+105/-8)
job-parts/osci_osi_common.sh (+0/-16)
job-parts/osci_tools_common.sh (+0/-2)
To merge this branch: bzr merge lp:~1chb1n/ubuntu-openstack-ci/artifact-move
Reviewer Review Type Date Requested Status
Ubuntu OpenStack CI Team Pending
Review via email: mp+294675@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2569 lp:ubuntu-openstack-ci for 1chb1n mp294675
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/2569/

346. By Ryan Beisner

Update amulet smoke runner

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2579 lp:ubuntu-openstack-ci for 1chb1n mp294675
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/2579/

347. By Ryan Beisner

Disable juju ppa switching; arrange all apt operations centrally.

348. By Ryan Beisner

Update maint_node

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2598 lp:ubuntu-openstack-ci for 1chb1n mp294675
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/2598/

349. By Ryan Beisner

Temporarily set juju root trace level logging

350. By Ryan Beisner

Undo trace log

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2619 lp:ubuntu-openstack-ci for 1chb1n mp294675
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/2619/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2015-02-18 04:49:11 +0000
3+++ .bzrignore 2016-05-18 11:59:22 +0000
4@@ -15,3 +15,4 @@
5 deployment/jobs/jobs-static-initial.tgz
6 temp.py
7 .coverage
8+deployment/deploy-files/novarc-artifactcloud
9
10=== added file 'admin/822-novarc-artifactweb-credentials-distribute.sh'
11--- admin/822-novarc-artifactweb-credentials-distribute.sh 1970-01-01 00:00:00 +0000
12+++ admin/822-novarc-artifactweb-credentials-distribute.sh 2016-05-18 11:59:22 +0000
13@@ -0,0 +1,29 @@
14+#!/bin/bash -e
15+echo $0
16+
17+# Copy artifactcloud credentials file to all nodes
18+# Requires that you have placed credentials in the deploy-files dir
19+
20+. $(dirname $0)/../env-common
21+
22+f_name="novarc-artifactcloud"
23+f_dst_dir="${JENKINS_HOME}"
24+f_dst="${f_dst_dir}/${f_name}"
25+f_tmp="${U_HOME}/${f_name}"
26+f_src_dir="../deployment/deploy-files"
27+f_src="${f_src_dir}/${f_name}"
28+
29+if [ ! -f "$f_src" ]; then
30+ echo "Local source file ${f_src} not found."
31+ pwd
32+ exit 1
33+fi
34+
35+for unit in $UNITS; do
36+ echo "copying ${f_src} into ${unit}"
37+ juju scp $f_src ${unit}:${f_tmp}
38+ echo "adjusting permissions"
39+ juju ssh $unit "sudo mv $f_tmp $f_dst &&\
40+ sudo chown jenkins:jenkins ${f_dst} &&\
41+ sudo chmod 600 ${f_dst}"
42+done
43
44=== modified file 'job-parts/build_amulet_smoke.sh'
45--- job-parts/build_amulet_smoke.sh 2016-04-05 17:47:28 +0000
46+++ job-parts/build_amulet_smoke.sh 2016-05-18 11:59:22 +0000
47@@ -4,69 +4,27 @@
48 # Source the common functions
49 . ${OSCI_ROOT}/job-parts/osci_job_common.sh
50
51-PREFER_CURRENT_LTS="trusty"
52-BLACKLIST_CURRENT_OS_DEV="mitaka"
53-
54 f_fresh_clean_start
55 f_check_out_universal
56+f_amulet_squash_00setup
57+f_amulet_set_network_env_vars
58+f_env_no_pass
59
60 f_line "Begin amulet smoke"
61 cd $CO_DIR
62-export AMULET_TESTS_ALL="$(find ./tests -maxdepth 1 -type f -executable -print | sort)"
63-
64-# Select Preferred Test: latest trusty test combo which is enabled and executable
65-# Exclude *git* (deploy-from-source) amulet test definitions.
66-export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep $PREFER_CURRENT_LTS | grep -v git | grep -v $BLACKLIST_CURRENT_OS_DEV | tail -n 1)"
67-
68-# Select Alternate Test: first in lexical order which is enabled and executable
69-# Exclude *git* (deploy-from-source) amulet test definitions.
70-if [[ -z "$AMULET_TEST_NAME" ]]; then
71- export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep -v git | grep -v $BLACKLIST_CURRENT_OS_DEV | head -n 1)"
72-fi
73-
74-# Still no test found based on preference or blacklist, just run with one.
75-# Exclude *git* (deploy-from-source) amulet test definitions.
76-if [[ -z "$AMULET_TEST_NAME" ]]; then
77- export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep -v git | head -n 1)"
78-fi
79-
80-# Look for 00-setup (amulet dependencies installer) and exec if found
81-AMULET_SETUP="$(find ./tests -type f -executable -name 00-setup -print | head -n 1)"
82-if [[ ! -z "$AMULET_SETUP" ]]; then
83- echo " . Executing amulet setup: $AMULET_SETUP"
84- $AMULET_SETUP
85+if grep "\[testenv:func27-smoke\]" tox.ini; then
86+ # Look for a func27-smoke tox target and run it as the first preference.
87+ tox -e func27-smoke
88 else
89- echo " ! Unable to find amulet 00-setup file. Proceeding anyway."
90-fi
91-
92-f_amulet_set_network_env_vars
93-f_env_no_pass
94-
95-if [[ -z "$AMULET_TEST_NAME" ]]; then
96- echo " ! Unable to determine which amulet test to run from $CO_DIR/tests"
97- ls -al $CO_DIR/tests
98- exit 1
99-fi
100-
101-echo " . Available amulet tests:"
102-echo "$AMULET_TESTS_ALL"
103-echo " . Automatically selected test: $AMULET_TEST_NAME"
104-
105-f_juju_bootstrap
106-
107-cd $CO_DIR
108-$AMULET_TEST_NAME |& tee $WORKSPACE/amulet-smoke.txt || true
109-if [[ "${PIPESTATUS[0]}" != "0" ]]; then
110- echo " ! Amulet smoke test failed: $AMULET_TEST_NAME."
111- touch $WORKSPACE/fyi-amulet-smoke.failed
112-fi
113-
114-f_line "Cleaning up deployer temp directories"
115-echo " - Removing dir: $CO_DIR"
116-cd $WORKSPACE
117-rm -rf $CO_DIR
118+ # No func27-smoke tox target exists, run a naked amulet test as smoke.
119+ echo " ! Tox-based amulet smoke target not found, falling back to automatic test selection."
120+ f_amulet_smoke_select_tests_fallback
121+ f_juju_bootstrap
122+ f_amulet_naked_test_run
123+fi
124 f_line "End amulet smoke"
125
126+f_remove_co_dir
127 f_collect_juju_logs
128 f_set_build_descr
129 f_nice_finish
130
131=== modified file 'job-parts/build_amulet_test.sh'
132--- job-parts/build_amulet_test.sh 2016-02-29 19:46:17 +0000
133+++ job-parts/build_amulet_test.sh 2016-05-18 11:59:22 +0000
134@@ -5,7 +5,7 @@
135 # Makefile command search strings, first match wins
136 sstring[0]="@juju test"
137 sstring[1]=".venv/bin/bundletester"
138-#sstring[2]=""
139+sstring[2]="@tox -e func27"
140 #sstring[3]=""
141 #sstring[4]=""
142
143@@ -28,6 +28,7 @@
144 f_line "begin amulet test"
145 f_juju_get_pkg_info juju-pkg-info.txt
146 f_run_makefile_test
147+f_get_func_results_file
148 f_line "end amulet test"
149
150 f_collect_juju_logs
151
152=== modified file 'job-parts/build_bucket_junk_cleanup.sh'
153--- job-parts/build_bucket_junk_cleanup.sh 2016-04-15 03:53:13 +0000
154+++ job-parts/build_bucket_junk_cleanup.sh 2016-05-18 11:59:22 +0000
155@@ -4,7 +4,7 @@
156
157 f_gerrit_set_blob_vars
158 env | egrep "BUILD|JOB_|GERRIT|UOSCI|HUDSON|JENKINS|WORKSPACE" | sort
159-f_novarc_undercloud
160+f_novarc_artifactcloud
161
162
163 f_line "Deleting junk objects"
164
165=== modified file 'job-parts/build_bucket_reset_object_headers.sh'
166--- job-parts/build_bucket_reset_object_headers.sh 2016-04-15 03:53:13 +0000
167+++ job-parts/build_bucket_reset_object_headers.sh 2016-05-18 11:59:22 +0000
168@@ -4,7 +4,7 @@
169
170 f_gerrit_set_blob_vars
171 env | egrep "BUILD|JOB_|GERRIT|UOSCI|HUDSON|JENKINS|WORKSPACE" | sort
172-f_novarc_undercloud
173+f_novarc_artifactcloud
174
175 f_bucket_reset_txt_html_object_headers
176
177
178=== modified file 'job-parts/build_bucket_update_indices.sh'
179--- job-parts/build_bucket_update_indices.sh 2016-04-15 03:53:13 +0000
180+++ job-parts/build_bucket_update_indices.sh 2016-05-18 11:59:22 +0000
181@@ -4,7 +4,7 @@
182
183 f_gerrit_set_blob_vars
184 env | egrep "BUILD|JOB_|GERRIT|UOSCI|HUDSON|JENKINS|WORKSPACE" | sort
185-f_novarc_undercloud
186+f_novarc_artifactcloud
187
188 f_bucket_create_index_of_indices
189 f_bucket_upload_index_of_indices
190
191=== modified file 'job-parts/build_charm_single.sh'
192--- job-parts/build_charm_single.sh 2016-04-22 16:23:41 +0000
193+++ job-parts/build_charm_single.sh 2016-05-18 11:59:22 +0000
194@@ -12,10 +12,10 @@
195 # Gerrit-triggered jobs will pass GERRIT_BRANCH, while other legacy
196 # jobs will pass GIT_BRANCH.
197 if [[ -z "$SUPPORTED_SERIES" ]] && [[ "$GERRIT_BRANCH" != *stable* ]] && [[ "$GIT_BRANCH" != *stable* ]]; then
198- # Master
199+ # Master (dev)
200 export SUPPORTED_SERIES="trusty wily xenial"
201 elif [[ -z "$SUPPORTED_SERIES" ]] && [[ "$GERRIT_BRANCH" != "master" ]] && [[ "$GIT_BRANCH" != "master" ]]; then
202- # Stable
203+ # Stable (released)
204 export SUPPORTED_SERIES="trusty wily xenial"
205 else
206 echo " ! Unable to determine SUPPORTED_SERIES based on GERRIT_BRANCH and/or GIT_BRANCH values"
207
208=== added file 'job-parts/build_maint_nodes.sh'
209--- job-parts/build_maint_nodes.sh 1970-01-01 00:00:00 +0000
210+++ job-parts/build_maint_nodes.sh 2016-05-18 11:59:22 +0000
211@@ -0,0 +1,27 @@
212+#!/bin/bash -e
213+# Build script to perform periodic jenkins master/slave maintenance tasks
214+
215+# Source the common functions
216+. ${OSCI_ROOT}/job-parts/osci_job_common.sh
217+
218+# Prep environment
219+f_skip_juju_lxc
220+f_fresh_clean_start
221+f_env_no_pass
222+
223+# Install/update to the latest version of mojo
224+f_mojo_install
225+
226+# Install/update to the latest version of openstack-installer
227+f_osi_install
228+
229+# Install/update to the latest version of git and bzr tools
230+f_vcs_tools_install
231+
232+# Install update misc tools
233+f_misc_global_tools_install
234+
235+# Wrap up
236+f_set_build_descr
237+f_nice_finish
238+f_check_fail
239
240=== modified file 'job-parts/build_mojo_runner.sh'
241--- job-parts/build_mojo_runner.sh 2016-02-29 21:54:46 +0000
242+++ job-parts/build_mojo_runner.sh 2016-05-18 11:59:22 +0000
243@@ -32,7 +32,6 @@
244 # Prep environment
245 f_fresh_clean_start
246 f_env_no_pass
247-f_mojo_install
248
249 f_line "validating mojo runner env vars"
250 f_mojo_handle_env_vars
251
252=== modified file 'job-parts/build_osi.sh'
253--- job-parts/build_osi.sh 2015-11-21 14:39:51 +0000
254+++ job-parts/build_osi.sh 2016-05-18 11:59:22 +0000
255@@ -38,7 +38,6 @@
256 f_env_no_pass
257 f_touch_try
258 f_amulet_set_network_env_vars
259-f_osi_install
260
261 # Go!
262 f_line "Deploy via OSI (openstack-installer mode: ${OSI_MODE})"
263
264=== renamed file 'job-parts/osci_vcs_common.sh' => 'job-parts/osci_apt_common.sh'
265--- job-parts/osci_vcs_common.sh 2016-02-24 19:45:46 +0000
266+++ job-parts/osci_apt_common.sh 2016-05-18 11:59:22 +0000
267@@ -2,13 +2,66 @@
268 #
269 # Common functions for UOSCI vcs systems (publicly-available information only!)
270
271+
272 function f_vcs_configure() {
273- dpkg-query --show bzr || sudo apt-get install bzr -y
274- dpkg-query --show git || sudo apt-get install git -y
275- dpkg-query --show git-review || sudo apt-get install git-review -y
276+f_line "vcs configure"
277 bzr whoami "uoscibot <uosci-testing-bot@ubuntu.com>"
278 bzr launchpad-login uosci-testing-bot
279 git config --global user.email "uosci-testing-bot@ubuntu.com"
280 git config --global user.name "uoscibot"
281 git config --global gitreview.username "uosci-testing-bot"
282 }
283+
284+
285+function f_vcs_tools_install() {
286+# VCS packages to keep installed and updated on all master/slaves
287+f_line "vcs tools install"
288+ sudo apt-get update -y &> /dev/null || true
289+ sudo apt-get install bzr -y
290+ sudo apt-get install git -y
291+ sudo apt-get install git-review -y
292+}
293+
294+
295+function f_misc_global_tools_install() {
296+# Misc packages to keep installed and updated on all master/slaves
297+f_line "misc global tools install"
298+ sudo apt-get update -y &> /dev/null || true
299+ sudo apt-get install ipcalc -y
300+ sudo apt-get install bzr-fastimport -y
301+ sudo apt-get install python-virtualenv libffi-dev libssl-dev -y
302+}
303+
304+
305+function f_mojo_install() {
306+# Install or upgrade mojo
307+f_line "mojo install"
308+ echo "Installing or upgrading mojo..."
309+ sudo add-apt-repository ppa:mojo-maintainers/ppa -y &> /dev/null || true
310+ sudo apt-get update -y &> /dev/null || true
311+ sudo apt-get install mojo -y || true
312+ if [ -z "$(apt-cache policy mojo | grep 'Installed:')" ]; then
313+ echo " ! Mojo install failed."
314+ exit 1
315+ fi
316+ echo "Mojo version:"
317+ mojo --version
318+ dpkg-query --list mojo
319+}
320+
321+
322+function f_osi_install() {
323+# Install or upgrade openstack-installer
324+f_line "osi install"
325+ echo " + Installing or upgrading openstack-installer..."
326+ sudo add-apt-repository ppa:cloud-installer/experimental -y &> /dev/null || true
327+ sudo apt-get update -y &> /dev/null || true
328+ sudo apt-get install openstack -y || true
329+ sudo apt-get install python3-pytest -y
330+ if [ -z "$(apt-cache policy openstack | grep 'Installed:')" ]; then
331+ echo " ! openstack-installer install failed."
332+ exit 1
333+ fi
334+ echo " . openstack-install version:"
335+ openstack-install --version
336+}
337
338=== modified file 'job-parts/osci_gerrit_common.sh'
339--- job-parts/osci_gerrit_common.sh 2016-04-15 14:13:15 +0000
340+++ job-parts/osci_gerrit_common.sh 2016-05-18 11:59:22 +0000
341@@ -151,7 +151,7 @@
342
343 function f_gerrit_set_blob_vars(){
344 export UOSCI_BUCKET_NAME="uosci-artifacts"
345- export UOSCI_BLOB_STORE="http://10.245.161.162/swift/v1/${UOSCI_BUCKET_NAME}" # no trailing slash!
346+ export UOSCI_BLOB_STORE="https://openstack-ci-reports.ubuntu.com/artifacts" # no trailing slash!
347
348 if [[ ! -z "$GERRIT_CHANGE_NUMBER" ]]; then
349 # GERRIT CHANGE TRIGGER
350@@ -173,7 +173,7 @@
351
352 f_gerrit_create_artifact_index
353 echo "Uploading..."
354- f_novarc_undercloud
355+ f_novarc_artifactcloud
356 swift upload $UOSCI_BUCKET_NAME --object-name $UOSCI_BLOB_PATH ${WORKSPACE}
357
358 # Set content-type for txt and html files
359@@ -182,7 +182,6 @@
360
361 # Temp Debug
362 echo "UOSCI_BLOB_URL: ${UOSCI_BLOB_URL}"
363- echo "Temp/private bucket: http://10.245.161.162/swift/v1/${UOSCI_BUCKET_NAME}/${UOSCI_BLOB_PATH}/index.html"
364 }
365
366
367@@ -195,10 +194,6 @@
368 swift post -H "content-type:text/html" $UOSCI_BUCKET_NAME index.html
369 swift stat $UOSCI_BUCKET_NAME index.html
370 set +x
371-
372- # Temp debug
373- echo "Temp/private bucket: http://10.245.161.162/swift/v1/${UOSCI_BUCKET_NAME}/index.html"
374- curl -IL http://10.245.161.162/swift/v1/${UOSCI_BUCKET_NAME}/index.html
375 }
376
377
378@@ -214,8 +209,7 @@
379
380 export _MSG_START="Build ${UOSCI_GERRIT_VERDICT} by Canonical OpenStack Charm CI."
381
382- export _MSG_MORE_INFO="- Note: We are working to expose artifact links publicly.
383-- Canonical OpenStack Charm CI Third Party Wiki: ${UOSCI_WIKI_LINK}
384+ export _MSG_MORE_INFO="- Canonical OpenStack Charm CI Third Party Wiki: ${UOSCI_WIKI_LINK}
385 - OpenStack Charmers Mailing List: ${UOSCI_ML_LINK}
386 - Developing OpenStack Charms: ${UOSCI_COMMUNITY_README_LINK}"
387
388@@ -304,7 +298,7 @@
389 add_line " <table>"
390
391 # Get index string from key 4, reverse sort by key 2 (date)
392- INDICES=$(swift list uosci-artifacts -l | grep -e 'index.html$' | grep -v '^index.html' | sort -rk 2 | awk '{ print $4 }')
393+ INDICES=$(swift list uosci-artifacts -l | grep -e 'index.html$' | grep -v ' index.html' | sort -rk 2 | awk '{ print $4 }')
394
395 for i in $INDICES; do
396 # link="<a href=\"${i}\">VIEW</a>"
397
398=== modified file 'job-parts/osci_job_common.sh'
399--- job-parts/osci_job_common.sh 2016-04-08 14:28:16 +0000
400+++ job-parts/osci_job_common.sh 2016-05-18 11:59:22 +0000
401@@ -10,7 +10,7 @@
402 . ${OSCI_ROOT}/job-parts/osci_jujudevel_common.sh
403 . ${OSCI_ROOT}/job-parts/osci_mojo_common.sh
404 . ${OSCI_ROOT}/job-parts/osci_osi_common.sh
405-. ${OSCI_ROOT}/job-parts/osci_vcs_common.sh
406+. ${OSCI_ROOT}/job-parts/osci_apt_common.sh
407 . ${OSCI_ROOT}/job-parts/osci_gerrit_common.sh
408
409
410@@ -262,6 +262,12 @@
411 }
412
413
414+function f_get_func_results_file() {
415+# Copy functional test results file if it exists
416+ cp -fv $CO_DIR/func-results.json $WORKSPACE/func-results.json.txt 2>/dev/null ||:
417+}
418+
419+
420 function f_check_out_lp_branch() {
421 # check out branch
422 if [[ -z "$BASE_NAME" ]] || [[ -z "$BRANCH" ]]; then
423@@ -555,6 +561,15 @@
424 }
425
426
427+function f_remove_co_dir() {
428+# Remove asset checkout directory from workspace
429+ f_line "Cleaning up deployer temp directories"
430+ echo " - Removing dir: $CO_DIR"
431+ cd $WORKSPACE
432+ rm -rf $CO_DIR
433+}
434+
435+
436 function f_line() {
437 echo "====> ${1} <======================="
438 }
439
440=== modified file 'job-parts/osci_jujudevel_common.sh'
441--- job-parts/osci_jujudevel_common.sh 2016-03-04 06:14:35 +0000
442+++ job-parts/osci_jujudevel_common.sh 2016-05-18 11:59:22 +0000
443@@ -2,6 +2,11 @@
444 #
445 # Common functions for UOSCI jobs, specific to exercising the
446 # development version of juju.
447+#
448+# /!\ This is pre-juju2 legacy wares for installing, detecting and switching
449+# juju environment names based on ppa value. This will not work well
450+# when juju1 and juju2 exist in the same ppas or in the same distro mains.
451+# Refactor and deprecation underway.
452
453 export JUJU_STABLE="ppa:juju/stable"
454 export JUJU_PROPOSED="ppa:juju/proposed"
455@@ -84,10 +89,15 @@
456 ;;
457 esac
458
459- echo " + Adding juju ppa ${JUJU_SOURCE} and updating packages."
460- sudo add-apt-repository $JUJU_SOURCE -y
461- sudo apt-get update -y 2>&1 > /dev/null
462- sudo apt-get install juju juju-core juju-deployer amulet charm-tools -y
463+ echo " ! DEPRECATED - NOT Adding or switching juju ppa ${JUJU_SOURCE} and updating packages."
464+ echo " ! Jenkins builds no longer install/upgrade/downgrade juju binaries."
465+# With the advent of juju2 and potential mixing of juju1 + juju2 in ppas, jobs are
466+# no longer installing juju. All legacy slaves should remain at juju 1.x, and will
467+# need to be maintained/upgraded outside of the job (ie. juju run) out of band.
468+# echo " + Adding juju ppa ${JUJU_SOURCE} and updating packages."
469+# sudo add-apt-repository $JUJU_SOURCE -y
470+# sudo apt-get update -y 2>&1 > /dev/null
471+# sudo apt-get install juju juju-core juju-deployer amulet charm-tools -y
472 f_juju_version_announce
473 f_juju_enviro_switcher
474
475
476=== modified file 'job-parts/osci_mojo_common.sh'
477--- job-parts/osci_mojo_common.sh 2016-04-21 17:42:40 +0000
478+++ job-parts/osci_mojo_common.sh 2016-05-18 11:59:22 +0000
479@@ -10,22 +10,6 @@
480 }
481
482
483-function f_mojo_install() {
484-# Install or upgrade mojo
485- echo "Installing or upgrading mojo..."
486- sudo add-apt-repository ppa:mojo-maintainers/ppa -y &> /dev/null || true
487- sudo apt-get update -y &> /dev/null || true
488- sudo apt-get install mojo -y || true
489- if [ -z "$(apt-cache policy mojo | grep 'Installed:')" ]; then
490- echo " ! Mojo install failed."
491- exit 1
492- fi
493- echo "Mojo version:"
494- mojo --version
495- dpkg-query --list mojo
496-}
497-
498-
499 function f_mojo_new_project() {
500 # Add mojo project.
501 if [[ -n "$(ls $WORKSPACE -1 | egrep '.failed|.bad')" ]]; then
502
503=== modified file 'job-parts/osci_openstack_common.sh'
504--- job-parts/osci_openstack_common.sh 2016-04-21 20:08:42 +0000
505+++ job-parts/osci_openstack_common.sh 2016-05-18 11:59:22 +0000
506@@ -5,11 +5,10 @@
507
508 function f_openstack_bundle_constraint_mod() {
509 # Bump some constraints to minimize resource footprint on undercloud.
510-# FYI 4160M gets an alt flavor with ~1/2 the disk usage.
511-# Undercloud should have a flavor which exactly matches mem, otherwise
512-# the next largest flavor (probably 8G) will be chosen.
513- echo "Modifying bundle constraints (4G:3072M)."
514- $OSCI_ROOT/tools/find_replace.py -yd -i "$BUNDLE_FILE" -o "$BUNDLE_FILE" -f "mem=4G" -r "mem=3072M" || touch $WORKSPACE/fyi-${test:0:4}.bundle-constraint-mod.failed
515+# ex.
516+# echo "Modifying bundle constraints (4G:3072M)."
517+# $OSCI_ROOT/tools/find_replace.py -yd -i "$BUNDLE_FILE" -o "$BUNDLE_FILE" -f "mem=4G" -r "mem=3072M" || touch $WORKSPACE/fyi-${test:0:4}.bundle-constraint-mod.failed
518+echo " . FYI no bundle mem constraint modifications"
519 }
520
521
522@@ -97,6 +96,95 @@
523 }
524
525
526+function f_amulet_squash_00setup() {
527+# Guard against ppa additions and deb package installations as are
528+# customarily attempted in tests/00-setup and/or tests/setup/00-setup.
529+# That is dangerous in CI automation as we need to control the juju
530+# and related tools versions on the slaves. Just squash them here.
531+ f_line "Squashing 00-setup files if they exist"
532+ AMULET_SETUP_FILES="$(find ./tests -type f -executable -name 00-setup -print)"
533+ if [[ ! -z "$AMULET_SETUP_FILES" ]]; then
534+ for f in $AMULET_SETUP_FILES; do
535+ echo " - Setting $f as non-executable (-x)"
536+ chmod -x $f
537+ stat $f
538+ done
539+ else
540+ echo " . No executable amulet 00-setup file(s) found (OK)."
541+ fi
542+}
543+
544+
545+function f_amulet_naked_test_run() {
546+# LEGACY! Run a single named amulet test. Must already be bootstrapped.
547+# This should only be used when amulet smoke tests are not defined in
548+# the charm's tox.ini. Once all charms use tox + bundletester for
549+# amulet and amulet smoke, this can be deprecated.
550+ if [[ -z "$CO_DIR" ]]; then
551+ echo " ! Missing the required CO_DIR env var."
552+ exit 1
553+ fi
554+ if [[ -z "$AMULET_TEST_NAME" ]]; then
555+ echo " ! Missing the required AMULET_TEST_NAME env var."
556+ exit 1
557+ fi
558+ cd $CO_DIR
559+ # Call the amulet test file directly
560+ $AMULET_TEST_NAME |& tee $WORKSPACE/amulet-smoke.txt || true
561+ if [[ "${PIPESTATUS[0]}" != "0" ]]; then
562+ echo " ! Amulet smoke test failed: $AMULET_TEST_NAME."
563+ touch $WORKSPACE/fyi-amulet-smoke.failed
564+ fi
565+}
566+
567+
568+function f_amulet_smoke_select_tests_fallback() {
569+# LEGACY! Only use this if/when a tox + bundletester amulet smoke
570+# target is not defined or found. This is intended only as a fallback
571+# with automatic test selection. OpenStack charms should all eventually
572+# have tox-defined tests.
573+
574+ # Need to update this each cycle
575+ export PREFER_CURRENT_LTS="trusty"
576+ export BLACKLIST_CURRENT_OS_DEV="mitaka"
577+
578+ if [[ -z "$CO_DIR" ]]; then
579+ echo " ! Missing the required CO_DIR env vars."
580+ exit 1
581+ fi
582+ cd $CO_DIR
583+
584+ export AMULET_TESTS_ALL="$(find ./tests -maxdepth 1 -type f -executable -print | sort)"
585+
586+ # Select Preferred Test: latest trusty test combo which is enabled and executable
587+ # Exclude *git* (deploy-from-source) amulet test definitions.
588+ export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep $PREFER_CURRENT_LTS | grep -v git | grep -v $BLACKLIST_CURRENT_OS_DEV | tail -n 1)"
589+
590+ # Select Alternate Test: first in lexical order which is enabled and executable
591+ # Exclude *git* (deploy-from-source) amulet test definitions.
592+ if [[ -z "$AMULET_TEST_NAME" ]]; then
593+ export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep -v git | grep -v $BLACKLIST_CURRENT_OS_DEV | head -n 1)"
594+ fi
595+
596+ # Still no test found based on preference or blacklist, just run with one.
597+ # Exclude *git* (deploy-from-source) amulet test definitions.
598+ if [[ -z "$AMULET_TEST_NAME" ]]; then
599+ export AMULET_TEST_NAME="$(echo "$AMULET_TESTS_ALL" | grep -v git | head -n 1)"
600+ fi
601+
602+ # Fail and bail if none found.
603+ if [[ -z "$AMULET_TEST_NAME" ]]; then
604+ echo " ! NO TEST FOUND - Unable to determine which amulet test to run from $CO_DIR/tests"
605+ ls -al $CO_DIR/tests
606+ exit 1
607+ fi
608+
609+ echo " . Available amulet tests:"
610+ echo "$AMULET_TESTS_ALL"
611+ echo " . Automatically selected test: $AMULET_TEST_NAME"
612+}
613+
614+
615 function f_amulet_set_odl_location() {
616 # Set ODL tarball location if not already set.
617 [[ -z "$AMULET_ODL_LOCATION" ]] && export AMULET_ODL_LOCATION='http://10.245.161.162/swift/v1/opendaylight/distribution-karaf-0.2.4-Helium-SR4.tar.gz'
618@@ -112,7 +200,6 @@
619
620 function f_openstack_set_network_env_vars() {
621 # Inspect the bootstrap node and set network environment variables based on that
622- dpkg-query --show ipcalc || sudo apt-get install ipcalc
623 export NAME_SERVER="$(grep nameserver /etc/resolv.conf | head -n 1 | awk '{ print $2 }' | xargs)"
624 export NET_ID="$(grep network ~/.juju/environments.yaml | head -n 1 | awk '{ print $2 }')"
625
626@@ -184,7 +271,6 @@
627 # Predictively set network environment variables before deployment exists
628 f_novarc_undercloud
629
630- dpkg-query --show ipcalc || sudo apt-get install ipcalc
631 export NAME_SERVER="$(grep nameserver /etc/resolv.conf | head -n 1 | awk '{ print $2 }' | xargs)"
632 export NET_ID="$(grep network ~/.juju/environments.yaml | head -n 1 | awk '{ print $2 }')"
633 export SUBNET_ID="$(neutron net-show $NET_ID | grep subnets | awk '{ print $4 }')"
634@@ -256,6 +342,12 @@
635 echo " ! Configure failed."
636 touch $WORKSPACE/fyi-${test:0:4}.configure.failed
637 fi
638+
639+ # Heat requires an action for Kilo and later to enable authorization
640+ if [[ "$OPENSTACK_RELEASE" != *icehouse* ]]; then
641+ echo " . Running domain-setup action on heat/0..."
642+ juju action do --format=json heat/0 domain-setup
643+ fi
644 }
645
646
647@@ -275,7 +367,6 @@
648
649
650 function f_openstack_tempest_venv() {
651- sudo apt-get install python-virtualenv libffi-dev libssl-dev -y
652 cd $OPENSTACK_CHARM_TESTING_ROOT/tempest
653 virtualenv .venv
654 .venv/bin/pip install -r requirements.txt
655@@ -411,6 +502,12 @@
656 }
657
658
659+function f_novarc_artifactcloud() {
660+ echo " . Sourcing artifactcloud novarc."
661+ . ~/novarc-artifactcloud
662+}
663+
664+
665 function f_flavor_shrink() {
666 # Shrink flavors for smaller/faster testing
667 echo " + Shrinking flavors."
668
669=== modified file 'job-parts/osci_osi_common.sh'
670--- job-parts/osci_osi_common.sh 2016-03-04 05:37:48 +0000
671+++ job-parts/osci_osi_common.sh 2016-05-18 11:59:22 +0000
672@@ -35,21 +35,6 @@
673 }
674
675
676-function f_osi_install() {
677-# Install or upgrade openstack-installer
678- echo " + Installing or upgrading openstack-installer..."
679- sudo add-apt-repository ppa:cloud-installer/experimental -y &> /dev/null || true
680- sudo apt-get update -y &> /dev/null || true
681- sudo apt-get install openstack -y || true
682- if [ -z "$(apt-cache policy openstack | grep 'Installed:')" ]; then
683- echo " ! openstack-installer install failed."
684- exit 1
685- fi
686- echo " . openstack-install version:"
687- openstack-install --version
688-}
689-
690-
691 function f_osi_config_file_pull_and_sanitize() {
692 # Pull openstack-installer config yaml to workspace (sanitize keys and passwords)
693 DEST_FILE="$WORKSPACE/osi-config.yaml"
694@@ -263,7 +248,6 @@
695 "multi"|"single"|"autopilot")
696 echo " . Starting OSI built-in ${OSI_MODE} mode test..."
697 f_osi_refresh
698- dpkg-query --show python3-pytest || sudo apt-get install python3-pytest -y
699 cd $OSI_ROOT/integration
700 py.test-3 tests/test_${OSI_MODE}.py |& tee $WORKSPACE/osi-test-${OSI_MODE}.txt
701 ret_code=${PIPESTATUS[0]}
702
703=== modified file 'job-parts/osci_tools_common.sh'
704--- job-parts/osci_tools_common.sh 2016-03-09 19:26:45 +0000
705+++ job-parts/osci_tools_common.sh 2016-05-18 11:59:22 +0000
706@@ -46,8 +46,6 @@
707 [[ -z "$MIG_TOOLS_REPO" ]] && export MIG_TOOLS_REPO="https://github.com/openstack-charmers/migration-tools"
708 [[ -z "$MIG_TOOLS_ROOT" ]] && export MIG_TOOLS_ROOT="$HOME/tools/migration-tools"
709
710- dpkg-query --show bzr-fastimport || sudo apt-get install bzr-fastimport -y
711-
712 if [[ -d $MIG_TOOLS_ROOT ]]; then
713 echo " - Removing existing dir @ $MIG_TOOLS_ROOT"
714 rm -rf $MIG_TOOLS_ROOT

Subscribers

People subscribed via source and target branches