summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2018-12-06 11:11:42 +0000
committerSorin Sbarnea <ssbarnea@redhat.com>2018-12-14 15:50:06 +0000
commited27a979d5c821f9275c063ff0610254e52e8188 (patch)
tree5c5081d3c999dbf67cb8daeca80b9cf08096ea4e
parent40b50f763c943ececc3bd37c9e8c92e3c431497e (diff)
Adopt use of pre-commit linting
Follows the same configuration that was used on tripleo-quickstart-extras and documented use on tripleo-docs. Change-Id: Iba8a2db92137f9f6ad28f498627eb1b87039d99f Story: https://tree.taiga.io/project/tripleo-ci-board/task/381
Notes
Notes (review): Code-Review+2: Marios Andreou <marios@redhat.com> Code-Review+2: Quique Llorente <ellorent@redhat.com> Verified-1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Workflow+1: Quique Llorente <ellorent@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 15 Dec 2018 14:20:02 +0000 Reviewed-on: https://review.openstack.org/623202 Project: openstack-infra/tripleo-ci Branch: refs/heads/master
-rw-r--r--.ansible-lint18
-rw-r--r--.pre-commit-config.yaml42
-rw-r--r--.yamllint6
-rwxr-xr-xplaybooks/tripleo-ci/templates/toci_quickstart.sh.j220
-rwxr-xr-xscripts/bighammer.sh6
-rwxr-xr-xscripts/bootstrap-overcloud-full.sh52
-rwxr-xr-xscripts/common_functions.sh21
-rw-r--r--scripts/common_vars.bash1
-rwxr-xr-xscripts/compare-reviews.py24
-rw-r--r--scripts/deploy-server.sh6
-rwxr-xr-xscripts/deploy.sh17
-rwxr-xr-xscripts/generate-kill-heat.sh12
-rwxr-xr-xscripts/getthelogs76
-rw-r--r--scripts/metrics.bash25
-rwxr-xr-xscripts/mirror-server/mirror-images.sh44
-rwxr-xr-xscripts/mirror-server/upload.cgi9
-rw-r--r--scripts/oooq_common_functions.sh2
-rwxr-xr-xscripts/te-broker/destroy-env7
-rwxr-xr-xscripts/te-broker/testenv-worker58
-rwxr-xr-xscripts/to_build3
-rwxr-xr-xscripts/tripleo.sh18
-rw-r--r--scripts/website/README.md2
-rwxr-xr-xscripts/website/generate_site.sh148
-rw-r--r--test-environments/net-iso.yaml3
-rw-r--r--test-environments/network-templates/nic-configs/ceph-storage.yaml10
-rw-r--r--test-environments/scheduler-hints.yaml1
-rw-r--r--test-requirements.txt4
-rwxr-xr-xtestenv-client24
-rw-r--r--toci-quickstart/config/collect-logs.yml1
-rw-r--r--toci-quickstart/config/testenv/multinode-rdocloud.yml1
-rw-r--r--toci-quickstart/config/testenv/ovb.yml1
-rwxr-xr-xtoci_quickstart.sh20
-rw-r--r--tox.ini3
-rw-r--r--zuul.d/layout.yaml4
-rw-r--r--zuul.d/nodesets.yaml1
35 files changed, 396 insertions, 294 deletions
diff --git a/.ansible-lint b/.ansible-lint
new file mode 100644
index 0000000..aca43b8
--- /dev/null
+++ b/.ansible-lint
@@ -0,0 +1,18 @@
1exclude_paths:
2 - roles/validate-ui/.travis.yml
3parseable: true
4rulesdir:
5 - ./ci-scripts/ansible_rules/
6quiet: false
7skip_list:
8 - ANSIBLE0006 # Using command rather than module we have a few use cases
9 # where we need to use curl and rsync
10 - ANSIBLE0007 # Using command rather than an argument to e.g file
11 # we have a lot of 'rm' command and we should use file module instead
12 - ANSIBLE0010 # Package installs should not use latest.
13 # Sometimes we need to update some packages.
14 - ANSIBLE0012 # Commands should not change things if nothing needs doing
15 - ANSIBLE0013 # Use Shell only when shell functionality is required
16 - ANSIBLE0016 # Tasks that run when changed should likely be handlers
17 # this requires refactoring roles, skipping for now
18verbosity: 1
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..09e2a3c
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,42 @@
1---
2repos:
3 - repo: https://github.com/pre-commit/pre-commit-hooks
4 rev: v2.0.0
5 hooks:
6 - id: trailing-whitespace
7 - id: mixed-line-ending
8 - id: check-byte-order-marker
9 - id: check-executables-have-shebangs
10 - id: check-merge-conflict
11 - id: debug-statements
12 - id: flake8
13 additional_dependencies:
14 - hacking<1.2.0,>=1.1.0
15 - id: check-yaml
16 files: .*\.(yaml|yml)$
17 # commented to allow progressive enablement in smaller patches
18 # - repo: https://github.com/adrienverge/yamllint.git
19 # rev: v1.13.0
20 # hooks:
21 # - id: yamllint
22 # files: \.(yaml|yml)$
23 # types: [file, yaml]
24 # entry: yamllint --strict -f parsable
25 - repo: https://github.com/ansible/ansible-lint
26 rev: v3.5.1
27 hooks:
28 - id: ansible-lint
29 files: \.(yaml|yml)$
30 entry: ansible-lint --force-color -v
31 - repo: https://github.com/openstack-dev/bashate.git
32 rev: 0.6.0
33 hooks:
34 - id: bashate
35 entry: bashate --error . --verbose --ignore=E006,E040
36 # Run bashate check for all bash scripts
37 # Ignores the following rules:
38 # E006: Line longer than 79 columns (as many scripts use jinja
39 # templating, this is very difficult)
40 # E040: Syntax error determined using `bash -n` (as many scripts
41 # use jinja templating, this will often fail and the syntax
42 # error will be discovered in execution anyway)
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..69b4b41
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,6 @@
1---
2extends: default
3
4rules:
5 line-length:
6 max: 180
diff --git a/playbooks/tripleo-ci/templates/toci_quickstart.sh.j2 b/playbooks/tripleo-ci/templates/toci_quickstart.sh.j2
index eaaf7d9..6852f91 100755
--- a/playbooks/tripleo-ci/templates/toci_quickstart.sh.j2
+++ b/playbooks/tripleo-ci/templates/toci_quickstart.sh.j2
@@ -151,16 +151,16 @@ done
151 for playbook in {{ " ".join(playbooks) }}; do 151 for playbook in {{ " ".join(playbooks) }}; do
152 echo ${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG} 152 echo ${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}
153 $QUICKSTART_INSTALL_CMD \ 153 $QUICKSTART_INSTALL_CMD \
154 ${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG} \ 154 ${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG} \
155 {{ nodes_args }} \ 155 {{ nodes_args }} \
156 {{ featureset_conf }} \ 156 {{ featureset_conf }} \
157 {{ env_vars }} \ 157 {{ env_vars }} \
158 {{ extra_vars }} \ 158 {{ extra_vars }} \
159 {{ vxlan_vars }} \ 159 {{ vxlan_vars }} \
160 $DEFAULT_ARGS \ 160 $DEFAULT_ARGS \
161 --extra-vars @{{ workspace }}/logs/zuul-variables.yaml \ 161 --extra-vars @{{ workspace }}/logs/zuul-variables.yaml \
162 $LOCAL_WORKING_DIR/playbooks/$playbook ${PLAYBOOKS_ARGS[$playbook]:-} \ 162 $LOCAL_WORKING_DIR/playbooks/$playbook ${PLAYBOOKS_ARGS[$playbook]:-} \
163 2>&1 | tee -a $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$? 163 2>&1 | tee -a $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$?
164 164
165 # Print status of playbook run 165 # Print status of playbook run
166 [[ "$exit_value" == 0 ]] && echo "Playbook run of $playbook passed successfully" 166 [[ "$exit_value" == 0 ]] && echo "Playbook run of $playbook passed successfully"
diff --git a/scripts/bighammer.sh b/scripts/bighammer.sh
index 4e2e43d..3c6ae5f 100755
--- a/scripts/bighammer.sh
+++ b/scripts/bighammer.sh
@@ -27,7 +27,7 @@ USER=centos
27# makes some assumptions but good enough for now 27# makes some assumptions but good enough for now
28nova keypair-add --pub-key ~/.ssh/id_rsa.pub bighammer || true 28nova keypair-add --pub-key ~/.ssh/id_rsa.pub bighammer || true
29 29
30function tapper(){ 30function tapper {
31 set -x 31 set -x
32 NODENAME=test-node-$1 32 NODENAME=test-node-$1
33 33
@@ -35,8 +35,8 @@ function tapper(){
35 #trap "nova delete $NODENAME" RETURN ERR 35 #trap "nova delete $NODENAME" RETURN ERR
36 sleep 60 36 sleep 60
37 if [ "$(nova show $NODENAME | awk '/status/ {print $4}')" != "ACTIVE" ] ; then 37 if [ "$(nova show $NODENAME | awk '/status/ {print $4}')" != "ACTIVE" ] ; then
38 nova show $NODENAME 38 nova show $NODENAME
39 return 1 39 return 1
40 fi 40 fi
41 41
42 IP=$(nova show $NODENAME | awk '/private network/ {print $5}') 42 IP=$(nova show $NODENAME | awk '/private network/ {print $5}')
diff --git a/scripts/bootstrap-overcloud-full.sh b/scripts/bootstrap-overcloud-full.sh
index 31b6fdb..d358959 100755
--- a/scripts/bootstrap-overcloud-full.sh
+++ b/scripts/bootstrap-overcloud-full.sh
@@ -51,30 +51,30 @@ except:
51export ELEMENTS_PATH="${COMMON_ELEMENTS_PATH}:/usr/share/instack-undercloud:/usr/share/tripleo-image-elements:/usr/share/tripleo-puppet-elements" 51export ELEMENTS_PATH="${COMMON_ELEMENTS_PATH}:/usr/share/instack-undercloud:/usr/share/tripleo-image-elements:/usr/share/tripleo-puppet-elements"
52ELEMENTS=$(\ 52ELEMENTS=$(\
53tripleo-build-images \ 53tripleo-build-images \
54 --image-json-output \ 54 --image-json-output \
55 --image-name overcloud-full \ 55 --image-name overcloud-full \
56 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \ 56 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \
57 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \ 57 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \
58 | jq '. | .[0].elements | map(.+" ") | add' \ 58 | jq '. | .[0].elements | map(.+" ") | add' \
59 | sed 's/"//g') 59 | sed 's/"//g')
60 60
61# delorean-repo is excluded b/c we've already run --repo-setup on this node and 61# delorean-repo is excluded b/c we've already run --repo-setup on this node and
62# we don't want to overwrite that. 62# we don't want to overwrite that.
63sudo -E instack \ 63sudo -E instack \
64 -e centos7 \ 64 -e centos7 \
65 enable-packages-install \ 65 enable-packages-install \
66 install-types \ 66 install-types \
67 $ELEMENTS \ 67 $ELEMENTS \
68 -k extra-data \ 68 -k extra-data \
69 pre-install \ 69 pre-install \
70 install \ 70 install \
71 post-install \ 71 post-install \
72 -b 05-fstab-rootfs-label \ 72 -b 05-fstab-rootfs-label \
73 00-fix-requiretty \ 73 00-fix-requiretty \
74 90-rebuild-ramdisk \ 74 90-rebuild-ramdisk \
75 00-usr-local-bin-secure-path \ 75 00-usr-local-bin-secure-path \
76 -x delorean-repo \ 76 -x delorean-repo \
77 -d 77 -d
78 78
79# In the imported elements we have remove-machine-id. In multinode 79# In the imported elements we have remove-machine-id. In multinode
80# jobs that could mean we end up without /etc/machine-id. Make sure 80# jobs that could mean we end up without /etc/machine-id. Make sure
@@ -83,12 +83,12 @@ sudo -E instack \
83 83
84PACKAGES=$(\ 84PACKAGES=$(\
85tripleo-build-images \ 85tripleo-build-images \
86 --image-json-output \ 86 --image-json-output \
87 --image-name overcloud-full \ 87 --image-name overcloud-full \
88 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \ 88 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images-centos7.yaml \
89 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \ 89 --image-config-file /usr/share/tripleo-common/image-yaml/overcloud-images.yaml \
90 | jq '. | .[0].packages | .[] | tostring' \ 90 | jq '. | .[0].packages | .[] | tostring' \
91 | sed 's/"//g') 91 | sed 's/"//g')
92 92
93# Install additional packages expected by the image 93# Install additional packages expected by the image
94sudo yum -y install $PACKAGES 94sudo yum -y install $PACKAGES
diff --git a/scripts/common_functions.sh b/scripts/common_functions.sh
index 6d36d82..4670e77 100755
--- a/scripts/common_functions.sh
+++ b/scripts/common_functions.sh
@@ -1,3 +1,4 @@
1#!/bin/bash
1# Tripleo CI functions 2# Tripleo CI functions
2 3
3# Revert a commit for tripleo ci 4# Revert a commit for tripleo ci
@@ -5,7 +6,7 @@
5# $2 : hash id of commit to revert 6# $2 : hash id of commit to revert
6# $3 : bug id of reason for revert (used to skip revert if found in commit 7# $3 : bug id of reason for revert (used to skip revert if found in commit
7# that triggers ci). 8# that triggers ci).
8function temprevert(){ 9function temprevert {
9 # Before reverting check to ensure this isn't the related fix 10 # Before reverting check to ensure this isn't the related fix
10 if git --git-dir=$TRIPLEO_ROOT/${ZUUL_PROJECT#*/}/.git log -1 | grep -iE "bug.*$3" ; then 11 if git --git-dir=$TRIPLEO_ROOT/${ZUUL_PROJECT#*/}/.git log -1 | grep -iE "bug.*$3" ; then
11 echo "Skipping temprevert because bug fix $3 was found in git message." 12 echo "Skipping temprevert because bug fix $3 was found in git message."
@@ -24,7 +25,7 @@ function temprevert(){
24# $2 : hash id of commit to pin too 25# $2 : hash id of commit to pin too
25# $3 : bug id of reason for the pin (used to skip revert if found in commit 26# $3 : bug id of reason for the pin (used to skip revert if found in commit
26# that triggers ci). 27# that triggers ci).
27function pin(){ 28function pin {
28 # Before reverting check to ensure this isn't the related fix 29 # Before reverting check to ensure this isn't the related fix
29 if git --git-dir=$TRIPLEO_ROOT/${ZUUL_PROJECT#*/}/.git log -1 | grep -iE "bug.*$3" ; then 30 if git --git-dir=$TRIPLEO_ROOT/${ZUUL_PROJECT#*/}/.git log -1 | grep -iE "bug.*$3" ; then
30 echo "Skipping pin because bug fix $3 was found in git message." 31 echo "Skipping pin because bug fix $3 was found in git message."
@@ -42,7 +43,7 @@ function pin(){
42# $2 : Gerrit refspec to cherry pick 43# $2 : Gerrit refspec to cherry pick
43# $3 : bug id of reason for the cherry pick (used to skip cherry pick if found 44# $3 : bug id of reason for the cherry pick (used to skip cherry pick if found
44# in commit that triggers ci). 45# in commit that triggers ci).
45function cherrypick(){ 46function cherrypick {
46 local PROJ_NAME=$1 47 local PROJ_NAME=$1
47 local REFSPEC=$2 48 local REFSPEC=$2
48 49
@@ -66,14 +67,14 @@ function cherrypick(){
66 67
67# echo's out a project name from a ref 68# echo's out a project name from a ref
68# $1 : e.g. openstack/nova:master:refs/changes/87/64787/3 returns nova 69# $1 : e.g. openstack/nova:master:refs/changes/87/64787/3 returns nova
69function filterref(){ 70function filterref {
70 PROJ=${1%%:*} 71 PROJ=${1%%:*}
71 PROJ=${PROJ##*/} 72 PROJ=${PROJ##*/}
72 echo $PROJ 73 echo $PROJ
73} 74}
74 75
75# Mount a qcow image, copy in the delorean repositories and update the packages 76# Mount a qcow image, copy in the delorean repositories and update the packages
76function update_image(){ 77function update_image {
77 IMAGE=$1 78 IMAGE=$1
78 MOUNTDIR=$(mktemp -d) 79 MOUNTDIR=$(mktemp -d)
79 case ${IMAGE##*.} in 80 case ${IMAGE##*.} in
@@ -133,7 +134,7 @@ function update_image(){
133 134
134# Decide if a particular cached artifact can be used in this CI test 135# Decide if a particular cached artifact can be used in this CI test
135# Takes a single argument representing the name of the artifact being checked. 136# Takes a single argument representing the name of the artifact being checked.
136function canusecache(){ 137function canusecache {
137 138
138 # If we are uploading to the cache then we shouldn't use it 139 # If we are uploading to the cache then we shouldn't use it
139 [ "$CACHEUPLOAD" == 1 ] && return 1 140 [ "$CACHEUPLOAD" == 1 ] && return 1
@@ -165,7 +166,7 @@ function canusecache(){
165 return 0 166 return 0
166} 167}
167 168
168function extract_logs(){ 169function extract_logs {
169 local name=$1 170 local name=$1
170 mkdir -p $WORKSPACE/logs/$name 171 mkdir -p $WORKSPACE/logs/$name
171 local logs_tar="$WORKSPACE/logs/$name.tar.xz" 172 local logs_tar="$WORKSPACE/logs/$name.tar.xz"
@@ -178,7 +179,7 @@ function extract_logs(){
178 fi 179 fi
179} 180}
180 181
181function postci(){ 182function postci {
182 local exit_val=${1:-0} 183 local exit_val=${1:-0}
183 set -x 184 set -x
184 set +e 185 set +e
@@ -368,10 +369,10 @@ function echo_vars_to_deploy_env {
368} 369}
369 370
370function stop_dstat { 371function stop_dstat {
371 ps axjf | grep bin/dstat | grep -v grep | awk '{print $2;}' | sudo xargs -t -n 1 -r kill 372 ps axjf | grep bin/dstat | grep -v grep | awk '{print $2;}' | sudo xargs -t -n 1 -r kill
372} 373}
373 374
374function item_in_array () { 375function item_in_array {
375 local item 376 local item
376 for item in "${@:2}"; do 377 for item in "${@:2}"; do
377 if [[ "$item" == "$1" ]]; then 378 if [[ "$item" == "$1" ]]; then
diff --git a/scripts/common_vars.bash b/scripts/common_vars.bash
index b56d467..441837e 100644
--- a/scripts/common_vars.bash
+++ b/scripts/common_vars.bash
@@ -1,3 +1,4 @@
1#!/bin/bash
1# Periodic stable jobs set OVERRIDE_ZUUL_BRANCH, gate stable jobs 2# Periodic stable jobs set OVERRIDE_ZUUL_BRANCH, gate stable jobs
2# just have the branch they're proposed to, e.g ZUUL_BRANCH, in both 3# just have the branch they're proposed to, e.g ZUUL_BRANCH, in both
3# cases we need to set STABLE_RELEASE to match for tripleo.sh 4# cases we need to set STABLE_RELEASE to match for tripleo.sh
diff --git a/scripts/compare-reviews.py b/scripts/compare-reviews.py
index afcd86d..bbe41cf 100755
--- a/scripts/compare-reviews.py
+++ b/scripts/compare-reviews.py
@@ -4,11 +4,11 @@ from __future__ import print_function
4import argparse 4import argparse
5import difflib 5import difflib
6import json 6import json
7import requests
8import os 7import os
8import requests
9 9
10from colorama import init
11from colorama import Fore 10from colorama import Fore
11from colorama import init
12 12
13GERRIT_DETAIL_API = "https://review.openstack.org/changes/{}/detail" 13GERRIT_DETAIL_API = "https://review.openstack.org/changes/{}/detail"
14GERRIT_USER_NAME = "zuul" 14GERRIT_USER_NAME = "zuul"
@@ -16,8 +16,9 @@ ZUUL_PIPELINE = "check"
16 16
17 17
18def parse_ci_message(message): 18def parse_ci_message(message):
19 """Convert zuul's gerrit message into a dict with job name as key and 19 """Convert zuul's gerrit message into a dict
20 job url as value 20
21 Dictionary contains job name as key and job url as value
21 """ 22 """
22 23
23 jobs = {} 24 jobs = {}
@@ -29,8 +30,7 @@ def parse_ci_message(message):
29 30
30 31
31def get_file(logs_url, file): 32def get_file(logs_url, file):
32 """Download a file from logs server for this job 33 """Download a file from logs server for this job"""
33 """
34 34
35 response = requests.get(logs_url + '/logs/' + file) 35 response = requests.get(logs_url + '/logs/' + file)
36 if response.ok: 36 if response.ok:
@@ -39,8 +39,7 @@ def get_file(logs_url, file):
39 39
40 40
41def get_last_jobs(change): 41def get_last_jobs(change):
42 """Get the last CI jobs execution at check pipeline for this review 42 """Get the last CI jobs execution at check pipeline for this review"""
43 """
44 43
45 last_jobs = {} 44 last_jobs = {}
46 detail_url = GERRIT_DETAIL_API.format(change) 45 detail_url = GERRIT_DETAIL_API.format(change)
@@ -62,8 +61,9 @@ def get_last_jobs(change):
62 61
63 62
64def download(jobs, file_path): 63def download(jobs, file_path):
65 """Download a file from all the specified jobs and return them as a 64 """Download a file from all the specified jobs
66 dictionary with job name as key and file content as value 65
66 Return them as a dictionary with job name as key and file content as value
67 """ 67 """
68 downloaded_files = {} 68 downloaded_files = {}
69 for job, logs in jobs.iteritems(): 69 for job, logs in jobs.iteritems():
@@ -76,9 +76,7 @@ def download(jobs, file_path):
76 76
77 77
78def is_equal(lho_jobs, rho_jobs, file_path): 78def is_equal(lho_jobs, rho_jobs, file_path):
79 """Check the differences of file_path between the lho and rho job sets and 79 """Prints differences of file_path between the lho and rho job sets"""
80 print out them
81 """
82 80
83 lho_files = download(lho_jobs, file_path) 81 lho_files = download(lho_jobs, file_path)
84 rho_files = download(rho_jobs, file_path) 82 rho_files = download(rho_jobs, file_path)
diff --git a/scripts/deploy-server.sh b/scripts/deploy-server.sh
index 026b58d..1c0fa51 100644
--- a/scripts/deploy-server.sh
+++ b/scripts/deploy-server.sh
@@ -11,9 +11,9 @@ echo puppetlabs-apache adrien-filemapper | xargs -n 1 puppet module install
11git clone https://github.com/puppetlabs/puppetlabs-vcsrepo.git /etc/puppet/modules/vcsrepo 11git clone https://github.com/puppetlabs/puppetlabs-vcsrepo.git /etc/puppet/modules/vcsrepo
12 12
13if [ -e /sys/class/net/eth1 ] ; then 13if [ -e /sys/class/net/eth1 ] ; then
14 echo -e 'DEVICE=eth1\nBOOTPROTO=dhcp\nONBOOT=yes\nPERSISTENT_DHCLIENT=yes\nPEERDNS=no' > /etc/sysconfig/network-scripts/ifcfg-eth1 14 echo -e 'DEVICE=eth1\nBOOTPROTO=dhcp\nONBOOT=yes\nPERSISTENT_DHCLIENT=yes\nPEERDNS=no' > /etc/sysconfig/network-scripts/ifcfg-eth1
15 ifdown eth1 15 ifdown eth1
16 ifup eth1 16 ifup eth1
17fi 17fi
18 18
19CIREPO=/opt/stack/tripleo-ci 19CIREPO=/opt/stack/tripleo-ci
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
index cabd09f..7d95f32 100755
--- a/scripts/deploy.sh
+++ b/scripts/deploy.sh
@@ -1,3 +1,4 @@
1#!/bin/bash
1set -eux 2set -eux
2set -o pipefail 3set -o pipefail
3 4
@@ -305,9 +306,9 @@ if [ "$OSINFRA" = "0" ]; then
305 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.register.nodes.seconds" 306 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.register.nodes.seconds"
306 307
307 if [ $INTROSPECT == 1 ] ; then 308 if [ $INTROSPECT == 1 ] ; then
308 start_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.introspect.seconds" 309 start_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.introspect.seconds"
309 $TRIPLEO_ROOT/tripleo-ci/scripts/tripleo.sh --introspect-nodes 310 $TRIPLEO_ROOT/tripleo-ci/scripts/tripleo.sh --introspect-nodes
310 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.introspect.seconds" 311 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.introspect.seconds"
311 fi 312 fi
312 313
313 if [ $PREDICTABLE_PLACEMENT == 1 ]; then 314 if [ $PREDICTABLE_PLACEMENT == 1 ]; then
@@ -451,7 +452,7 @@ if [ "$MULTINODE" == 0 ] && [ "$OVERCLOUD" == 1 ] ; then
451 echo "crm_resource for openstack-heat-engine has failed!" 452 echo "crm_resource for openstack-heat-engine has failed!"
452 exit $exitcode 453 exit $exitcode
453 } 454 }
454 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.overcloud.settle.seconds" 455 stop_metric "tripleo.${STABLE_RELEASE:-master}.${TOCI_JOBTYPE}.overcloud.settle.seconds"
455 fi 456 fi
456fi 457fi
457 458
@@ -464,10 +465,10 @@ if [ "$OVERCLOUD_MAJOR_UPGRADE" == 1 ] ; then
464 # and thus the contents of delorean-ci may contain packages 465 # and thus the contents of delorean-ci may contain packages
465 # we want to test for the current branch on upgrade 466 # we want to test for the current branch on upgrade
466 if [ -s /etc/nodepool/sub_nodes_private ]; then 467 if [ -s /etc/nodepool/sub_nodes_private ]; then
467 for ip in $(cat /etc/nodepool/sub_nodes_private); do 468 for ip in $(cat /etc/nodepool/sub_nodes_private); do
468 ssh $SSH_OPTIONS -tt -i /etc/nodepool/id_rsa $ip \ 469 ssh $SSH_OPTIONS -tt -i /etc/nodepool/id_rsa $ip \
469 sudo sed -i -e \"s/enabled=0/enabled=1/\" /etc/yum.repos.d/delorean-ci.repo 470 sudo sed -i -e \"s/enabled=0/enabled=1/\" /etc/yum.repos.d/delorean-ci.repo
470 done 471 done
471 fi 472 fi
472 473
473 source ~/stackrc 474 source ~/stackrc
diff --git a/scripts/generate-kill-heat.sh b/scripts/generate-kill-heat.sh
index 72f9f27..27e5c17 100755
--- a/scripts/generate-kill-heat.sh
+++ b/scripts/generate-kill-heat.sh
@@ -6,12 +6,12 @@ set -o pipefail
6TMPFILE=$(mktemp) 6TMPFILE=$(mktemp)
7TMP2FILE=$(mktemp) 7TMP2FILE=$(mktemp)
8 8
9function heat_resource_metadata() { 9function heat_resource_metadata {
10 # Build os-collect-config command line arguments for the given heat 10 # Build os-collect-config command line arguments for the given heat
11 # resource, which when run, allow us to collect the heat completion 11 # resource, which when run, allow us to collect the heat completion
12 # signals. 12 # signals.
13 heat resource-metadata overcloud $1 | jq '.["os-collect-config"]["cfn"]' | grep \" | tr -d '\n' | sed -e 's/"//g' -e 's/_/-/g' -e 's/: / /g' -e 's/, / --cfn-/g' -e 's/^ /--cfn-/' -e 's/$/ --print/' 13 heat resource-metadata overcloud $1 | jq '.["os-collect-config"]["cfn"]' | grep \" | tr -d '\n' | sed -e 's/"//g' -e 's/_/-/g' -e 's/: / /g' -e 's/, / --cfn-/g' -e 's/^ /--cfn-/' -e 's/$/ --print/'
14 echo 14 echo
15} 15}
16 16
17>$TMPFILE 17>$TMPFILE
diff --git a/scripts/getthelogs b/scripts/getthelogs
index b269cb8..08490e2 100755
--- a/scripts/getthelogs
+++ b/scripts/getthelogs
@@ -1,36 +1,36 @@
1#!/bin/bash 1#!/bin/bash
2set -eu -o pipefail 2set -eu -o pipefail
3 3
4function usage(){ 4function usage {
5 echo "Helper script for downloading tripleo-ci jobs logs" 5 echo "Helper script for downloading tripleo-ci jobs logs"
6 echo 6 echo
7 echo "Example:" 7 echo "Example:"
8 echo "getthelogs http://logs.openstack.org/00/123456/7/check/gate-tripleo-ci-foo/d3adbeef" 8 echo "getthelogs http://logs.openstack.org/00/123456/7/check/gate-tripleo-ci-foo/d3adbeef"
9 echo 9 echo
10 echo "Downloads the logs and starts a shell from the logs root directory" 10 echo "Downloads the logs and starts a shell from the logs root directory"
11} 11}
12 12
13function finish(){ 13function finish {
14 rc=${rc:-$?} 14 rc=${rc:-$?}
15 trap - EXIT 15 trap - EXIT
16 cd $TDIR/../ 16 cd $TDIR/../
17 echo "Download job exited ${rc}" 17 echo "Download job exited ${rc}"
18 PS1="JOBLOGS ]\$ " bash --noprofile --norc 18 PS1="JOBLOGS ]\$ " bash --noprofile --norc
19} 19}
20 20
21function get_dirs(){ 21function get_dirs {
22 local drop="\b(etc|ara|ara_oooq|docs|build|stackviz|sudoers.d|config-data|extra)\b" 22 local drop="\b(etc|ara|ara_oooq|docs|build|stackviz|sudoers.d|config-data|extra)\b"
23 local directories="" 23 local directories=""
24 directories=$(curl -s "$1" 2> /dev/null | grep -E "\[DIR" | grep -vE "${drop}" | sed -e "s,.*href=\"\([^\"]*\)\".*,${1}\1,g") 24 directories=$(curl -s "$1" 2> /dev/null | grep -E "\[DIR" | grep -vE "${drop}" | sed -e "s,.*href=\"\([^\"]*\)\".*,${1}\1,g")
25 if [ -n "$directories" ]; then 25 if [ -n "$directories" ]; then
26 for d in $directories; do 26 for d in $directories; do
27 directories="$directories $(get_dirs $d/)" 27 directories="$directories $(get_dirs $d/)"
28 done 28 done
29 echo $directories 29 echo $directories
30 else 30 else
31 echo "" 31 echo ""
32 fi 32 fi
33 return 0 33 return 0
34} 34}
35 35
36[[ "${1:--}" =~ ^\s+?- ]] && (usage; exit 1) 36[[ "${1:--}" =~ ^\s+?- ]] && (usage; exit 1)
@@ -42,12 +42,12 @@ BASEURL=${1%/}
42SC=$(dirname $BASEURL | grep -o \/ | wc -w) 42SC=$(dirname $BASEURL | grep -o \/ | wc -w)
43if [[ $BASEURL =~ 'logs.rdoproject' && SC -le 9 ]] ||\ 43if [[ $BASEURL =~ 'logs.rdoproject' && SC -le 9 ]] ||\
44 [[ $BASEURL =~ 'logs.rdoproject.org/openstack-periodic' && SC -le 5 ]]; then 44 [[ $BASEURL =~ 'logs.rdoproject.org/openstack-periodic' && SC -le 5 ]]; then
45 console="$BASEURL/console.txt.gz" 45 console="$BASEURL/console.txt.gz"
46elif [[ ! $(basename $BASEURL) == 'logs' && SC -le 7 ]]; then 46elif [[ ! $(basename $BASEURL) == 'logs' && SC -le 7 ]]; then
47 console="$BASEURL/job-output.txt.gz" 47 console="$BASEURL/job-output.txt.gz"
48 BASEURL=${BASEURL}/logs 48 BASEURL=${BASEURL}/logs
49else 49else
50 console='' 50 console=''
51fi 51fi
52TDIR=${BASEURL##*http://} 52TDIR=${BASEURL##*http://}
53TDIR=${TDIR##*https://} 53TDIR=${TDIR##*https://}
@@ -59,18 +59,18 @@ echo "Target dir for download: $TDIR"
59echo Will download logs from the following URLs: 59echo Will download logs from the following URLs:
60list_to_get="$console $(get_dirs $BASEURL/)" 60list_to_get="$console $(get_dirs $BASEURL/)"
61for d in $list_to_get; do 61for d in $list_to_get; do
62 echo $d 62 echo $d
63done 63done
64 64
65rm -f wget-jobs.txt 65rm -f wget-jobs.txt
66for d in $list_to_get; do 66for d in $list_to_get; do
67 args="\"-nv -nc --no-use-server-timestamps \ 67 args="\"-nv -nc --no-use-server-timestamps \
68 --accept-regex='\.txt\.gz$|messages$' \ 68 --accept-regex='\.txt\.gz$|messages$' \
69 --reject='index.html*' \ 69 --reject='index.html*' \
70 --recursive -l 10 --domains logs.openstack.org,logs.rdoproject.org \ 70 --recursive -l 10 --domains logs.openstack.org,logs.rdoproject.org \
71 --no-parent \ 71 --no-parent \
72 -erobots=off --wait 0.25 ${d}\"" 72 -erobots=off --wait 0.25 ${d}\""
73 echo "${args}" >> wget-jobs.txt 73 echo "${args}" >> wget-jobs.txt
74done 74done
75 75
76cat wget-jobs.txt | sed -n '{p;p}' | shuf > wget-jobs-shuf.txt 76cat wget-jobs.txt | sed -n '{p;p}' | shuf > wget-jobs-shuf.txt
diff --git a/scripts/metrics.bash b/scripts/metrics.bash
index c433846..f68f76a 100644
--- a/scripts/metrics.bash
+++ b/scripts/metrics.bash
@@ -1,3 +1,4 @@
1#!/bin/bash
1export METRICS_START_TIMES=/tmp/metric-start-times 2export METRICS_START_TIMES=/tmp/metric-start-times
2export METRICS_DATA_FILE=/tmp/metrics-data 3export METRICS_DATA_FILE=/tmp/metrics-data
3 4
@@ -17,9 +18,12 @@ function record_metric {
17# called. NOTE: time metrics names must be unique. 18# called. NOTE: time metrics names must be unique.
18function start_metric { 19function start_metric {
19 local NAME=$1 20 local NAME=$1
20 local START_TIME=$(date +%s) 21 local METRIC_NAME
22 local START_TIME
23 START_TIME=$(date +%s)
24
21 # we use : as our delimiter so convert to _. Also convert spaces and /'s. 25 # we use : as our delimiter so convert to _. Also convert spaces and /'s.
22 local METRIC_NAME=$(echo "$1" | sed -e 's|[\ \///:]|_|g') 26 METRIC_NAME=$(echo "$1" | sed -e 's|[\ \///:]|_|g')
23 27
24 if grep -c "^$METRIC_NAME:" $METRICS_START_TIMES &>/dev/null; then 28 if grep -c "^$METRIC_NAME:" $METRICS_START_TIMES &>/dev/null; then
25 echo "start_metric has already been called for $NAME" >&2 29 echo "start_metric has already been called for $NAME" >&2
@@ -33,18 +37,23 @@ function start_metric {
33# The total time (in seconds) is calculated and logged to the metrics 37# The total time (in seconds) is calculated and logged to the metrics
34# data file. NOTE: the end time is used as the DTS. 38# data file. NOTE: the end time is used as the DTS.
35function stop_metric { 39function stop_metric {
40 local END_TIME
41 local LINE
42 local METRIC_NAME
36 local NAME=$1 43 local NAME=$1
37 local METRIC_NAME=$(echo "$1" | sed -e 's|[\ \///:]|_|g') 44 local START_TIME
38 local END_TIME=$(date +%s) 45 local TOTAL_TIME
46
47 METRIC_NAME=$(echo "$1" | sed -e 's|[\ \///:]|_|g')
48 END_TIME=$(date +%s)
39 if ! grep -c "^$METRIC_NAME" $METRICS_START_TIMES &>/dev/null; then 49 if ! grep -c "^$METRIC_NAME" $METRICS_START_TIMES &>/dev/null; then
40 echo "Please call start_metric before calling stop_metric for $NAME" >&2 50 echo "Please call start_metric before calling stop_metric for $NAME" >&2
41 exit 1 51 exit 1
42 fi 52 fi
43 local LINE=$(grep "^$METRIC_NAME:" $METRICS_START_TIMES) 53 LINE=$(grep "^$METRIC_NAME:" $METRICS_START_TIMES)
44 local START_TIME=$(grep "^$METRIC_NAME:" $METRICS_START_TIMES | cut -d ':' -f '2') 54 START_TIME=$(grep "^$METRIC_NAME:" $METRICS_START_TIMES | cut -d ':' -f '2')
45 local TOTAL_TIME="$(($END_TIME - $START_TIME))" 55 TOTAL_TIME="$(($END_TIME - $START_TIME))"
46 record_metric "$METRIC_NAME" "$TOTAL_TIME" "$END_TIME" 56 record_metric "$METRIC_NAME" "$TOTAL_TIME" "$END_TIME"
47
48} 57}
49 58
50function metrics_to_graphite { 59function metrics_to_graphite {
diff --git a/scripts/mirror-server/mirror-images.sh b/scripts/mirror-server/mirror-images.sh
index 7cfbf41..51bcc73 100755
--- a/scripts/mirror-server/mirror-images.sh
+++ b/scripts/mirror-server/mirror-images.sh
@@ -6,31 +6,31 @@ MIRRORURL="https://images.rdoproject.org/${RELEASE}/delorean/current-tripleo"
6IMAGES="overcloud-full.tar ironic-python-agent.tar" 6IMAGES="overcloud-full.tar ironic-python-agent.tar"
7 7
8function check_new_image { 8function check_new_image {
9 local img=$1 9 local img=$1
10 wget ${MIRRORURL}/${img}.md5 -O test_md5 -o /dev/null || { 10 wget ${MIRRORURL}/${img}.md5 -O test_md5 -o /dev/null || {
11 echo "File ${MIRRORURL}/${img}.md5 doesn't present, can NOT continue" 11 echo "File ${MIRRORURL}/${img}.md5 doesn't present, can NOT continue"
12 exit 1 12 exit 1
13 } 13 }
14 diff -q test_md5 ${img}.md5 >/dev/null 14 diff -q test_md5 ${img}.md5 >/dev/null
15} 15}
16 16
17function update_images { 17function update_images {
18 for img in $IMAGES; do 18 for img in $IMAGES; do
19 wget ${MIRRORURL}/${img} -O ${img}-${RELEASE} 19 wget ${MIRRORURL}/${img} -O ${img}-${RELEASE}
20 wget ${MIRRORURL}/${img}.md5 -O ${img}-${RELEASE}.md5 20 wget ${MIRRORURL}/${img}.md5 -O ${img}-${RELEASE}.md5
21 down_md5="$(cat ${img}-${RELEASE}.md5 | awk {'print $1'})" 21 down_md5="$(cat ${img}-${RELEASE}.md5 | awk {'print $1'})"
22 real_md5="$(md5sum ${img}-${RELEASE} | awk {'print $1'})" 22 real_md5="$(md5sum ${img}-${RELEASE} | awk {'print $1'})"
23 if [[ "$down_md5" == "$real_md5" ]]; then 23 if [[ "$down_md5" == "$real_md5" ]]; then
24 mv -f ${img}-${RELEASE} ${img} 24 mv -f ${img}-${RELEASE} ${img}
25 mv -f ${img}-${RELEASE}.md5 ${img}.md5 25 mv -f ${img}-${RELEASE}.md5 ${img}.md5
26 else 26 else
27 echo "md5 doesn't match, image download was broken!" 27 echo "md5 doesn't match, image download was broken!"
28 echo "Calculated md5 is $real_md5 and downloaded is $down_md5" 28 echo "Calculated md5 is $real_md5 and downloaded is $down_md5"
29 rm -f "${img}-${RELEASE}" 29 rm -f "${img}-${RELEASE}"
30 rm -f "${img}-${RELEASE}.md5" 30 rm -f "${img}-${RELEASE}.md5"
31 fi 31 fi
32 done 32 done
33 wget ${MIRRORURL}/delorean_hash.txt -O delorean_hash.txt -o /dev/null 33 wget ${MIRRORURL}/delorean_hash.txt -O delorean_hash.txt -o /dev/null
34} 34}
35 35
36mkdir -p $BUILDS 36mkdir -p $BUILDS
diff --git a/scripts/mirror-server/upload.cgi b/scripts/mirror-server/upload.cgi
index a59e416..b70ac75 100755
--- a/scripts/mirror-server/upload.cgi
+++ b/scripts/mirror-server/upload.cgi
@@ -1,16 +1,18 @@
1#!/bin/python3.4 1#!/bin/python3.4
2 2
3from builtins import FileExistsError
3import cgi 4import cgi
4import cgitb
5import fcntl 5import fcntl
6import os 6import os
7import shutil 7import shutil
8import sys 8import sys
9import tempfile 9import tempfile
10 10
11basedir="/var/www/html/" 11basedir = "/var/www/html/"
12 12
13print("Content-Type: text/html\n") 13print("Content-Type: text/html\n")
14
15
14def saveform(form, storagedir): 16def saveform(form, storagedir):
15 for key in form.keys(): 17 for key in form.keys():
16 entry = form[key] 18 entry = form[key]
@@ -36,6 +38,7 @@ def saveform(form, storagedir):
36 fp.write(line) 38 fp.write(line)
37 fp.close() 39 fp.close()
38 40
41
39def run(): 42def run():
40 43
41 if not os.environ.get("REMOTE_ADDR", "").startswith("192.168."): 44 if not os.environ.get("REMOTE_ADDR", "").startswith("192.168."):
@@ -73,5 +76,5 @@ def run():
73 fcntl.lockf(fd, fcntl.LOCK_UN) 76 fcntl.lockf(fd, fcntl.LOCK_UN)
74 os.close(fd) 77 os.close(fd)
75 78
76sys.exit(run())
77 79
80sys.exit(run())
diff --git a/scripts/oooq_common_functions.sh b/scripts/oooq_common_functions.sh
index 302efd3..284d52e 100644
--- a/scripts/oooq_common_functions.sh
+++ b/scripts/oooq_common_functions.sh
@@ -65,7 +65,7 @@ function is_featureset {
65 local type="${1}" 65 local type="${1}"
66 local featureset_file="${2}" 66 local featureset_file="${2}"
67 67
68 [ $(shyaml get-value "${type}" "False"< "${featureset_file}") = "True" ] 68 [[ $(shyaml get-value "${type}" "False"< "${featureset_file}") = "True" ]]
69} 69}
70 70
71function run_with_timeout { 71function run_with_timeout {
diff --git a/scripts/te-broker/destroy-env b/scripts/te-broker/destroy-env
index ff4209c..2958565 100755
--- a/scripts/te-broker/destroy-env
+++ b/scripts/te-broker/destroy-env
@@ -21,7 +21,7 @@ set -x
21# NOTE(bnemec): This function starts the port deletions in the background. 21# NOTE(bnemec): This function starts the port deletions in the background.
22# To ensure they complete before you proceed, you must call "wait" after 22# To ensure they complete before you proceed, you must call "wait" after
23# calling this function. 23# calling this function.
24function delete_ports() { 24function delete_ports {
25 local subnetid=${1:-} 25 local subnetid=${1:-}
26 if [ -z "$subnetid" ]; then 26 if [ -z "$subnetid" ]; then
27 return 27 return
@@ -37,8 +37,7 @@ CONSOLE_LOG_PATH=/var/www/html/tebroker/console-logs/
37nova console-log bmc-${ENVNUM} | tail -n 100 | awk -v envnum="$ENVNUM" '$0=envnum ": " $0' >> /var/log/bmc-console-logs 37nova console-log bmc-${ENVNUM} | tail -n 100 | awk -v envnum="$ENVNUM" '$0=envnum ": " $0' >> /var/log/bmc-console-logs
38 38
39# Save all the consoles in the stack to a dedicated directory, stripping out ANSI color codes. 39# Save all the consoles in the stack to a dedicated directory, stripping out ANSI color codes.
40for server in $(openstack server list -f value -c Name | grep baremetal-${ENVNUM}) bmc-$ENVNUM 40for server in $(openstack server list -f value -c Name | grep baremetal-${ENVNUM}) bmc-$ENVNUM ; do
41do
42 openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' | gzip > $CONSOLE_LOG_PATH/$server-console.log.gz || true 41 openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' | gzip > $CONSOLE_LOG_PATH/$server-console.log.gz || true
43done 42done
44 43
@@ -55,7 +54,7 @@ wait
55# If there was a keypair for this specific run, delete it. 54# If there was a keypair for this specific run, delete it.
56openstack keypair delete "tripleo-ci-key-$ENVNUM" || true 55openstack keypair delete "tripleo-ci-key-$ENVNUM" || true
57 56
58function delete_stack() { 57function delete_stack {
59 local stackname=$1 58 local stackname=$1
60 # Nothing to do if the specified stack doesn't exist 59 # Nothing to do if the specified stack doesn't exist
61 if ! heat stack-show $stackname; then 60 if ! heat stack-show $stackname; then
diff --git a/scripts/te-broker/testenv-worker b/scripts/te-broker/testenv-worker
index 899519d..de0a83b 100755
--- a/scripts/te-broker/testenv-worker
+++ b/scripts/te-broker/testenv-worker
@@ -23,8 +23,8 @@ import json
23import logging 23import logging
24import logging.handlers 24import logging.handlers
25import os 25import os
26import sys
27import subprocess 26import subprocess
27import sys
28import tempfile 28import tempfile
29import threading 29import threading
30import time 30import time
@@ -35,9 +35,11 @@ from novaclient import client as novaclient
35from novaclient import exceptions 35from novaclient import exceptions
36 36
37# 100Mb log files 37# 100Mb log files
38maxBytes=1024*1024*100 38maxBytes = 1024*1024*100
39 39
40logging.basicConfig(filename="/var/www/html/tebroker/testenv-worker.log", format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') 40logging.basicConfig(
41 filename="/var/www/html/tebroker/testenv-worker.log",
42 format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
41 43
42 44
43class CallbackClient(gear.Client): 45class CallbackClient(gear.Client):
@@ -86,7 +88,7 @@ class TEWorkerThread(threading.Thread):
86 self.runJob() 88 self.runJob()
87 except gear.InterruptedError: 89 except gear.InterruptedError:
88 logger.info('getJob interrupted...') 90 logger.info('getJob interrupted...')
89 except: 91 except Exception:
90 logger.exception('Error while run_te_worker worker') 92 logger.exception('Error while run_te_worker worker')
91 self.running = False 93 self.running = False
92 94
@@ -132,17 +134,18 @@ class TEWorkerThread(threading.Thread):
132 with tempfile.NamedTemporaryFile('r') as fp: 134 with tempfile.NamedTemporaryFile('r') as fp:
133 os.environ["TE_DATAFILE"] = fp.name 135 os.environ["TE_DATAFILE"] = fp.name
134 logger.info( 136 logger.info(
135 subprocess.check_output([self.scriptfiles[0], 137 subprocess.check_output([
136 self.num, 138 self.scriptfiles[0],
137 arguments.get("envsize","2"), 139 self.num,
138 arguments.get("ucinstance",""), 140 arguments.get("envsize", "2"),
139 arguments.get("create_undercloud", ""), 141 arguments.get("ucinstance", ""),
140 arguments.get("ssh_key", ""), 142 arguments.get("create_undercloud", ""),
141 arguments.get("net_iso", "multi-nic"), 143 arguments.get("ssh_key", ""),
142 arguments.get("compute_envsize","0"), 144 arguments.get("net_iso", "multi-nic"),
143 arguments.get("extra_nodes", "0"), 145 arguments.get("compute_envsize", "0"),
144 ], 146 arguments.get("extra_nodes", "0"),
145 stderr=subprocess.STDOUT)) 147 ],
148 stderr=subprocess.STDOUT))
146 clientdata = fp.read() 149 clientdata = fp.read()
147 except subprocess.CalledProcessError as e: 150 except subprocess.CalledProcessError as e:
148 logger.error(e.output) 151 logger.error(e.output)
@@ -164,7 +167,8 @@ class TEWorkerThread(threading.Thread):
164 if not cb_job.running: 167 if not cb_job.running:
165 logger.error("No sign of the Callback job starting," 168 logger.error("No sign of the Callback job starting,"
166 "assuming its no longer present") 169 "assuming its no longer present")
167 clientdata = subprocess.check_output([self.scriptfiles[1], self.num], stderr=subprocess.STDOUT) 170 clientdata = subprocess.check_output(
171 [self.scriptfiles[1], self.num], stderr=subprocess.STDOUT)
168 logger.info(clientdata) 172 logger.info(clientdata)
169 client.shutdown() 173 client.shutdown()
170 return 174 return
@@ -182,7 +186,8 @@ class TEWorkerThread(threading.Thread):
182 else: 186 else:
183 logger.info('Returned from Job : %s', cb_job.data) 187 logger.info('Returned from Job : %s', cb_job.data)
184 try: 188 try:
185 clientdata = subprocess.check_output([self.scriptfiles[1], self.num], stderr=subprocess.STDOUT) 189 clientdata = subprocess.check_output(
190 [self.scriptfiles[1], self.num], stderr=subprocess.STDOUT)
186 except subprocess.CalledProcessError as e: 191 except subprocess.CalledProcessError as e:
187 logger.error(e.output) 192 logger.error(e.output)
188 raise 193 raise
@@ -238,7 +243,7 @@ def _check_instance_alive(nclient, instance, event):
238 """ 243 """
239 if instance: 244 if instance:
240 try: 245 try:
241 i = nclient.servers.get(instance) 246 nclient.servers.get(instance)
242 except exceptions.NotFound: 247 except exceptions.NotFound:
243 # There is a very brief period of time where instance could be set 248 # There is a very brief period of time where instance could be set
244 # and event not. It's unlikely to happen, but let's be safe. 249 # and event not. It's unlikely to happen, but let's be safe.
@@ -254,8 +259,10 @@ def main(args=sys.argv[1:]):
254 '"locked" state while it calls back to the client. The ' 259 '"locked" state while it calls back to the client. The '
255 'clients job is provided with data (contents of datafile)' 260 'clients job is provided with data (contents of datafile)'
256 ) 261 )
257 parser.add_argument('scriptfiles', nargs=2, 262 parser.add_argument(
258 help='Path to a script whos output is provided to the client') 263 'scriptfiles',
264 nargs=2,
265 help='Path to a script whos output is provided to the client')
259 parser.add_argument('--timeout', '-t', type=int, default=10800, 266 parser.add_argument('--timeout', '-t', type=int, default=10800,
260 help='The maximum number of seconds to hold the ' 267 help='The maximum number of seconds to hold the '
261 'testenv for, can be overridden by the client.') 268 'testenv for, can be overridden by the client.')
@@ -271,7 +278,10 @@ def main(args=sys.argv[1:]):
271 278
272 global logger 279 global logger
273 logger = logging.getLogger('testenv-worker-' + opts.tenum) 280 logger = logging.getLogger('testenv-worker-' + opts.tenum)
274 logger.addHandler(logging.handlers.RotatingFileHandler("/var/www/html/tebroker/testenv-worker.log", maxBytes=maxBytes, backupCount=5)) 281 logger.addHandler(logging.handlers.RotatingFileHandler(
282 "/var/www/html/tebroker/testenv-worker.log",
283 maxBytes=maxBytes,
284 backupCount=5))
275 logger.setLevel(logging.INFO) 285 logger.setLevel(logging.INFO)
276 logger.removeHandler(logger.handlers[0]) 286 logger.removeHandler(logger.handlers[0])
277 287
@@ -279,7 +289,11 @@ def main(args=sys.argv[1:]):
279 logger.setLevel(logging.DEBUG) 289 logger.setLevel(logging.DEBUG)
280 290
281 logger.info('Starting test-env worker with data %r', opts.scriptfiles) 291 logger.info('Starting test-env worker with data %r', opts.scriptfiles)
282 te_worker = TEWorkerThread(opts.geard, opts.tenum, opts.timeout, opts.scriptfiles) 292 te_worker = TEWorkerThread(
293 opts.geard,
294 opts.tenum,
295 opts.timeout,
296 opts.scriptfiles)
283 297
284 te_worker.start() 298 te_worker.start()
285 299
diff --git a/scripts/to_build b/scripts/to_build
index 9a7a373..671970b 100755
--- a/scripts/to_build
+++ b/scripts/to_build
@@ -9,8 +9,7 @@ function set_env {
9# The updates job already takes a long time, always use cache for it 9# The updates job already takes a long time, always use cache for it
10[[ "$TOCI_JOBTYPE" =~ updates ]] && set_env "false" 10[[ "$TOCI_JOBTYPE" =~ updates ]] && set_env "false"
11# There are some projects that require images building 11# There are some projects that require images building
12for PROJFULLREF in ${ZUUL_CHANGES//^/ }; 12for PROJFULLREF in ${ZUUL_CHANGES//^/ }; do
13do
14 PROJ=${PROJFULLREF%%:*}; 13 PROJ=${PROJFULLREF%%:*};
15 PROJ=${PROJ##*/}; 14 PROJ=${PROJ##*/};
16 [[ "$PROJ" =~ diskimage-builder|tripleo-image-elements|tripleo-puppet-elements|instack-undercloud|python-tripleoclient|tripleo-common ]] && set_env "true" 15 [[ "$PROJ" =~ diskimage-builder|tripleo-image-elements|tripleo-puppet-elements|instack-undercloud|python-tripleoclient|tripleo-common ]] && set_env "true"
diff --git a/scripts/tripleo.sh b/scripts/tripleo.sh
index 894703b..4de216a 100755
--- a/scripts/tripleo.sh
+++ b/scripts/tripleo.sh
@@ -167,11 +167,11 @@ NODEPOOL_RDO_PROXY=${NODEPOOL_RDO_PROXY:-https://trunk.rdoproject.org}
167NODEPOOL_BUILDLOGS_CENTOS_PROXY="${NODEPOOL_BUILDLOGS_CENTOS_PROXY:-https://buildlogs.centos.org}" 167NODEPOOL_BUILDLOGS_CENTOS_PROXY="${NODEPOOL_BUILDLOGS_CENTOS_PROXY:-https://buildlogs.centos.org}"
168NODEPOOL_CBS_CENTOS_PROXY="${NODEPOOL_CBS_CENTOS_PROXY:-https://cbs.centos.org/repos}" 168NODEPOOL_CBS_CENTOS_PROXY="${NODEPOOL_CBS_CENTOS_PROXY:-https://cbs.centos.org/repos}"
169OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF=${OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF}"\ 169OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF=${OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF}"\
170 $REPO_PREFIX/$CEPH_REPO_FILE" 170 $REPO_PREFIX/$CEPH_REPO_FILE"
171OPSTOOLS_REPO_ENABLED=${OPSTOOLS_REPO_ENABLED:-"0"} 171OPSTOOLS_REPO_ENABLED=${OPSTOOLS_REPO_ENABLED:-"0"}
172if [[ "${OPSTOOLS_REPO_ENABLED}" = 1 ]]; then 172if [[ "${OPSTOOLS_REPO_ENABLED}" = 1 ]]; then
173 OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF=${OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF}"\ 173 OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF=${OVERCLOUD_IMAGES_DIB_YUM_REPO_CONF}"\
174 $REPO_PREFIX/centos-opstools.repo" 174 $REPO_PREFIX/centos-opstools.repo"
175fi 175fi
176FEATURE_BRANCH=${FEATURE_BRANCH:-} 176FEATURE_BRANCH=${FEATURE_BRANCH:-}
177DELOREAN_SETUP=${DELOREAN_SETUP:-""} 177DELOREAN_SETUP=${DELOREAN_SETUP:-""}
@@ -250,7 +250,11 @@ function log {
250} 250}
251 251
252function source_rc { 252function source_rc {
253 if [ $1 = "stackrc" ] ; then cloud="Undercloud"; else cloud="Overcloud"; fi 253 if [ $1 = "stackrc" ]; then
254 cloud="Undercloud"
255 else
256 cloud="Overcloud"
257 fi
254 echo "You must source a $1 file for the $cloud." 258 echo "You must source a $1 file for the $cloud."
255 echo "Attempting to source $HOME/$1" 259 echo "Attempting to source $HOME/$1"
256 source $HOME/$1 260 source $HOME/$1
@@ -665,8 +669,7 @@ function overcloud_deploy {
665 exitval=0 669 exitval=0
666 log "Deploy command arguments: $OVERCLOUD_DEPLOY_ARGS" 670 log "Deploy command arguments: $OVERCLOUD_DEPLOY_ARGS"
667 openstack overcloud deploy $OVERCLOUD_DEPLOY_ARGS || exitval=1 671 openstack overcloud deploy $OVERCLOUD_DEPLOY_ARGS || exitval=1
668 if [ $exitval -eq 1 ]; 672 if [ $exitval -eq 1 ]; then
669 then
670 log "Overcloud create - FAILED!" 673 log "Overcloud create - FAILED!"
671 exit 1 674 exit 1
672 fi 675 fi
@@ -713,8 +716,7 @@ function overcloud_update {
713 log "Overcloud update started." 716 log "Overcloud update started."
714 exitval=0 717 exitval=0
715 openstack overcloud deploy $OVERCLOUD_UPDATE_ARGS || exitval=1 718 openstack overcloud deploy $OVERCLOUD_UPDATE_ARGS || exitval=1
716 if [ $exitval -eq 1 ]; 719 if [ $exitval -eq 1 ]; then
717 then
718 log "Overcloud update - FAILED!" 720 log "Overcloud update - FAILED!"
719 exit 1 721 exit 1
720 fi 722 fi
diff --git a/scripts/website/README.md b/scripts/website/README.md
index b32f945..023bfb1 100644
--- a/scripts/website/README.md
+++ b/scripts/website/README.md
@@ -30,7 +30,7 @@ and Lauchpad API connections) and generate the CI reports which contact
30the API of the upstream Jenkins servers. 30the API of the upstream Jenkins servers.
31 31
32If you want to do a quick build to test out new HTML formatting, etc. you 32If you want to do a quick build to test out new HTML formatting, etc. you
33can disable the reviewday and CI reports by running the following: 33can disable the reviewday and CI reports by running the following:
34 34
35 cd tripleo-ci/scripts/website 35 cd tripleo-ci/scripts/website
36 SKIP\_REVIEWDAY="Y" SKIP\_CI\_REPORTS="Y" OUT\_HTML='out\_html' bash generate\_site.sh 36 SKIP\_REVIEWDAY="Y" SKIP\_CI\_REPORTS="Y" OUT\_HTML='out\_html' bash generate\_site.sh
diff --git a/scripts/website/generate_site.sh b/scripts/website/generate_site.sh
index 2552424..458bc98 100755
--- a/scripts/website/generate_site.sh
+++ b/scripts/website/generate_site.sh
@@ -24,32 +24,32 @@ SKIP_BLOG=${SKIP_BLOG:-''}
24 24
25# TRIPLEO-DOCS 25# TRIPLEO-DOCS
26if [ ! -d tripleo-docs ]; then 26if [ ! -d tripleo-docs ]; then
27 git clone git://git.openstack.org/openstack/tripleo-docs 27 git clone git://git.openstack.org/openstack/tripleo-docs
28 pushd tripleo-docs 28 pushd tripleo-docs
29 tox -edocs #initial run 29 tox -edocs #initial run
30 popd 30 popd
31else 31else
32 pushd tripleo-docs 32 pushd tripleo-docs
33 git reset --hard origin/master 33 git reset --hard origin/master
34 git pull 34 git pull
35 # NOTE(bnemec): We need to rebuild this venv each time or changes to 35 # NOTE(bnemec): We need to rebuild this venv each time or changes to
36 # tripleosphinx won't be picked up. 36 # tripleosphinx won't be picked up.
37 tox -re docs 37 tox -re docs
38 popd 38 popd
39fi 39fi
40 40
41# TRIPLEO SPHINX 41# TRIPLEO SPHINX
42if [ ! -d tripleosphinx ]; then 42if [ ! -d tripleosphinx ]; then
43 git clone https://github.com/dprince/tripleosphinx.git 43 git clone https://github.com/dprince/tripleosphinx.git
44 pushd tripleosphinx 44 pushd tripleosphinx
45 tox -edocs #creates the blank.html 45 tox -edocs #creates the blank.html
46 popd 46 popd
47else 47else
48 pushd tripleosphinx 48 pushd tripleosphinx
49 git reset --hard origin/master 49 git reset --hard origin/master
50 git pull 50 git pull
51 tox -edocs #creates the blank.html 51 tox -edocs #creates the blank.html
52 popd 52 popd
53fi 53fi
54 54
55# swap in custom tripleosphinx 55# swap in custom tripleosphinx
@@ -60,33 +60,33 @@ popd
60 60
61#REVIEWDAY 61#REVIEWDAY
62if [ ! -d reviewday ]; then 62if [ ! -d reviewday ]; then
63 git clone git://git.openstack.org/openstack-infra/reviewday 63 git clone git://git.openstack.org/openstack-infra/reviewday
64else 64else
65 pushd reviewday 65 pushd reviewday
66 git reset --hard origin/master 66 git reset --hard origin/master
67 git pull 67 git pull
68 popd 68 popd
69fi 69fi
70 70
71#TRIPLEO CI 71#TRIPLEO CI
72if [ ! -d tripleo-ci ]; then 72if [ ! -d tripleo-ci ]; then
73 git clone git://git.openstack.org/openstack-infra/tripleo-ci 73 git clone git://git.openstack.org/openstack-infra/tripleo-ci
74else 74else
75 pushd tripleo-ci 75 pushd tripleo-ci
76 git reset --hard origin/master 76 git reset --hard origin/master
77 git pull 77 git pull
78 popd 78 popd
79fi 79fi
80 80
81#Planet (Blog Feed Aggregator) 81#Planet (Blog Feed Aggregator)
82PLANET_DIR='planet-venus' 82PLANET_DIR='planet-venus'
83if [ ! -d '$PLANET_DIR' ]; then 83if [ ! -d '$PLANET_DIR' ]; then
84 git clone https://github.com/rubys/venus.git $PLANET_DIR 84 git clone https://github.com/rubys/venus.git $PLANET_DIR
85else 85else
86 pushd $PLANET_DIR 86 pushd $PLANET_DIR
87 git reset --hard origin/master 87 git reset --hard origin/master
88 git pull 88 git pull
89 popd 89 popd
90fi 90fi
91 91
92#----------------------------------------- 92#-----------------------------------------
@@ -104,54 +104,54 @@ $SUDO_CP mkdir -p $OUT_HTML
104 104
105# Reviewday 105# Reviewday
106if [ -z "$SKIP_REVIEWDAY" ]; then 106if [ -z "$SKIP_REVIEWDAY" ]; then
107 pushd reviewday 107 pushd reviewday
108 tox -erun -- "-p $REVIEWDAY_INPUT_FILE" 108 tox -erun -- "-p $REVIEWDAY_INPUT_FILE"
109 $SUDO_CP cp -a arrow* out_report/*.png out_report/*.js out_report/*.css $OUT_HTML 109 $SUDO_CP cp -a arrow* out_report/*.png out_report/*.js out_report/*.css $OUT_HTML
110 DATA=$(cat out_report/data_table.html) 110 DATA=$(cat out_report/data_table.html)
111 popd 111 popd
112 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/reviews.html 112 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/reviews.html
113 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html 113 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html
114 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half 114 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half
115 echo "<h1>TripleO Reviews</h1>" >> $OUT_FILE 115 echo "<h1>TripleO Reviews</h1>" >> $OUT_FILE
116 sed -e "s|<title>.*|<title>TripleO: Reviews</title>|" -i $OUT_FILE # custom title 116 sed -e "s|<title>.*|<title>TripleO: Reviews</title>|" -i $OUT_FILE # custom title
117 sed -e "s|<title>.*|<title>TripleO: Reviews</title><meta name='description' content='OpenStack Deployment Program Reviews'/>|" -i $OUT_FILE # custom title 117 sed -e "s|<title>.*|<title>TripleO: Reviews</title><meta name='description' content='OpenStack Deployment Program Reviews'/>|" -i $OUT_FILE # custom title
118 echo "$DATA" >> $OUT_FILE 118 echo "$DATA" >> $OUT_FILE
119 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half 119 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
120fi 120fi
121 121
122# TripleO CI 122# TripleO CI
123if [ -z "$SKIP_CI_REPORTS" ]; then 123if [ -z "$SKIP_CI_REPORTS" ]; then
124 pushd tripleo-ci 124 pushd tripleo-ci
125 125
126 # jobs report 126 # jobs report
127 tox -ecireport -- -b '^.*' 127 tox -ecireport -- -b '^.*'
128 DATA=$(cat tripleo-jobs.html-table) 128 DATA=$(cat tripleo-jobs.html-table)
129 popd 129 popd
130 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/cistatus.html 130 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/cistatus.html
131 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html 131 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html
132 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half 132 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half
133 echo "<h1>TripleO CI Status</h1>" >> $OUT_FILE 133 echo "<h1>TripleO CI Status</h1>" >> $OUT_FILE
134 sed -e "s|<title>.*|<title>TripleO: CI Status</title><meta name='description' content='OpenStack Deployment Program CI Status results'/>|" -i $OUT_FILE # custom title 134 sed -e "s|<title>.*|<title>TripleO: CI Status</title><meta name='description' content='OpenStack Deployment Program CI Status results'/>|" -i $OUT_FILE # custom title
135 echo "$DATA" >> $OUT_FILE 135 echo "$DATA" >> $OUT_FILE
136 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half 136 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
137fi 137fi
138 138
139# Planet 139# Planet
140if [ -z "$SKIP_BLOG" ]; then 140if [ -z "$SKIP_BLOG" ]; then
141 cp $SCRIPT_DIR/tripleo-ci/scripts/website/planet* $SCRIPT_DIR/$PLANET_DIR 141 cp $SCRIPT_DIR/tripleo-ci/scripts/website/planet* $SCRIPT_DIR/$PLANET_DIR
142 pushd $SCRIPT_DIR/$PLANET_DIR 142 pushd $SCRIPT_DIR/$PLANET_DIR
143 mkdir output 143 mkdir output
144 rm planet.html.tmplc # cleanup from previous runs 144 rm planet.html.tmplc # cleanup from previous runs
145 python planet.py planet.config.ini 145 python planet.py planet.config.ini
146 popd 146 popd
147 DATA=$(cat $PLANET_DIR/output/planet.html) 147 DATA=$(cat $PLANET_DIR/output/planet.html)
148 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/planet.html 148 OUT_FILE=$SCRIPT_DIR/tripleo-docs/doc/build/html/planet.html
149 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html 149 TEMPLATE_FILE=$SCRIPT_DIR/tripleosphinx/doc/build/html/blank.html
150 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half 150 sed -n '1,/.*Custom Content Here/p' $TEMPLATE_FILE > $OUT_FILE #first half
151 echo "<h1>Planet TripleO</h1>" >> $OUT_FILE 151 echo "<h1>Planet TripleO</h1>" >> $OUT_FILE
152 sed -e "s|<title>.*|<title>Planet TripleO</title><meta name='description' content='OpenStack Deployment Program Planet'/>|" -i $OUT_FILE # custom title 152 sed -e "s|<title>.*|<title>Planet TripleO</title><meta name='description' content='OpenStack Deployment Program Planet'/>|" -i $OUT_FILE # custom title
153 echo "$DATA" >> $OUT_FILE 153 echo "$DATA" >> $OUT_FILE
154 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half 154 sed -n '/.*Custom Content Here/,$p' $TEMPLATE_FILE >> $OUT_FILE #second half
155fi 155fi
156 156
157# Copy in the new web pages 157# Copy in the new web pages
diff --git a/test-environments/net-iso.yaml b/test-environments/net-iso.yaml
index 6a76b63..c21b1fc 100644
--- a/test-environments/net-iso.yaml
+++ b/test-environments/net-iso.yaml
@@ -1,5 +1,6 @@
1---
1parameter_defaults: 2parameter_defaults:
2 ControlPlaneSubnetCidr: "24" 3 ControlPlaneSubnetCidr: "24"
3 ControlPlaneDefaultRoute: 192.168.24.1 4 ControlPlaneDefaultRoute: 192.168.24.1
4 EC2MetadataIp: 192.168.24.1 5 EC2MetadataIp: 192.168.24.1
5 DnsServers: ["8.8.8.8","8.8.4.4"] 6 DnsServers: ["8.8.8.8", "8.8.4.4"]
diff --git a/test-environments/network-templates/nic-configs/ceph-storage.yaml b/test-environments/network-templates/nic-configs/ceph-storage.yaml
index a71f40a..35c1fe3 100644
--- a/test-environments/network-templates/nic-configs/ceph-storage.yaml
+++ b/test-environments/network-templates/nic-configs/ceph-storage.yaml
@@ -25,7 +25,7 @@ parameters:
25 default: '' 25 default: ''
26 description: IP address/subnet on the tenant network 26 description: IP address/subnet on the tenant network
27 type: string 27 type: string
28 ManagementIpSubnet: # Only populated when including environments/network-management.yaml 28 ManagementIpSubnet: # Only populated when including environments/network-management.yaml
29 default: '' 29 default: ''
30 description: IP address/subnet on the management network 30 description: IP address/subnet on the management network
31 type: string 31 type: string
@@ -62,18 +62,18 @@ parameters:
62 default: '10.0.0.1' 62 default: '10.0.0.1'
63 description: default route for the external network 63 description: default route for the external network
64 type: string 64 type: string
65 ControlPlaneSubnetCidr: # Override this via parameter_defaults 65 ControlPlaneSubnetCidr: # Override this via parameter_defaults
66 default: '24' 66 default: '24'
67 description: The subnet CIDR of the control plane network. 67 description: The subnet CIDR of the control plane network.
68 type: string 68 type: string
69 ControlPlaneDefaultRoute: # Override this via parameter_defaults 69 ControlPlaneDefaultRoute: # Override this via parameter_defaults
70 description: The default route of the control plane network. 70 description: The default route of the control plane network.
71 type: string 71 type: string
72 DnsServers: # Override this via parameter_defaults 72 DnsServers: # Override this via parameter_defaults
73 default: [] 73 default: []
74 description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. 74 description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
75 type: comma_delimited_list 75 type: comma_delimited_list
76 EC2MetadataIp: # Override this via parameter_defaults 76 EC2MetadataIp: # Override this via parameter_defaults
77 description: The IP address of the EC2 metadata server. 77 description: The IP address of the EC2 metadata server.
78 type: string 78 type: string
79 79
diff --git a/test-environments/scheduler-hints.yaml b/test-environments/scheduler-hints.yaml
index 9ef1c26..5607110 100644
--- a/test-environments/scheduler-hints.yaml
+++ b/test-environments/scheduler-hints.yaml
@@ -1,3 +1,4 @@
1---
1parameter_defaults: 2parameter_defaults:
2 ControllerSchedulerHints: 3 ControllerSchedulerHints:
3 'capabilities:node': 'controller-%index%' 4 'capabilities:node': 'controller-%index%'
diff --git a/test-requirements.txt b/test-requirements.txt
index 6167416..8924a75 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,8 +1,8 @@
1flake8
2pytest 1pytest
3pytest-html 2pytest-html
4pytest-cov 3pytest-cov
5mock 4mock
6requests 5requests
7pprint 6pprint
8PyYAML 7pre-commit>=1.10 # MIT License
8PyYAML \ No newline at end of file
diff --git a/testenv-client b/testenv-client
index 551db22..1502d79 100755
--- a/testenv-client
+++ b/testenv-client
@@ -21,9 +21,9 @@
21import argparse 21import argparse
22import json 22import json
23import logging 23import logging
24import sys
25import subprocess
26import os 24import os
25import subprocess
26import sys
27import tempfile 27import tempfile
28import textwrap 28import textwrap
29import threading 29import threading
@@ -65,7 +65,8 @@ class TestCallback(object):
65 if time_waiting > 90: 65 if time_waiting > 90:
66 logger.warn('%.1f seconds waiting for a worker.' % (time_waiting)) 66 logger.warn('%.1f seconds waiting for a worker.' % (time_waiting))
67 67
68 if "Couldn't retrieve env" in job.arguments or "Failed creating OVB stack" in job.arguments: 68 if "Couldn't retrieve env" in job.arguments or \
69 "Failed creating OVB stack" in job.arguments:
69 logger.error(job.arguments) 70 logger.error(job.arguments)
70 self.rv = 2 71 self.rv = 2
71 job.sendWorkComplete("") 72 job.sendWorkComplete("")
@@ -80,7 +81,7 @@ class TestCallback(object):
80 81
81 try: 82 try:
82 self.rv = subprocess.call(self.command) 83 self.rv = subprocess.call(self.command)
83 except: 84 except Exception:
84 logger.exception("Error calling command") 85 logger.exception("Error calling command")
85 self.rv = 2 86 self.rv = 2
86 87
@@ -195,14 +196,14 @@ def main(args=sys.argv[1:]):
195 job_params = { 196 job_params = {
196 "callback_name": callback_name, 197 "callback_name": callback_name,
197 "timeout": opts.timeout, 198 "timeout": opts.timeout,
198 "envsize":opts.envsize, 199 "envsize": opts.envsize,
199 "compute_envsize":opts.compute_envsize, 200 "compute_envsize": opts.compute_envsize,
200 "ucinstance":opts.ucinstance, 201 "ucinstance": opts.ucinstance,
201 "create_undercloud": "true" if opts.create_undercloud else "", 202 "create_undercloud": "true" if opts.create_undercloud else "",
202 "ssh_key":opts.ssh_key, 203 "ssh_key": opts.ssh_key,
203 "net_iso":opts.net_iso, 204 "net_iso": opts.net_iso,
204 "extra_nodes":opts.extra_nodes, 205 "extra_nodes": opts.extra_nodes,
205 "job_identifier":job_identifier, 206 "job_identifier": job_identifier,
206 } 207 }
207 job = gear.Job('lockenv', json.dumps(job_params)) 208 job = gear.Job('lockenv', json.dumps(job_params))
208 client.submitJob(job) 209 client.submitJob(job)
@@ -227,5 +228,6 @@ def main(args=sys.argv[1:]):
227 logger.debug("Exiting with status : %d", cb.rv) 228 logger.debug("Exiting with status : %d", cb.rv)
228 return cb.rv 229 return cb.rv
229 230
231
230if __name__ == '__main__': 232if __name__ == '__main__':
231 exit(main()) 233 exit(main())
diff --git a/toci-quickstart/config/collect-logs.yml b/toci-quickstart/config/collect-logs.yml
index 5054399..c815f5b 100644
--- a/toci-quickstart/config/collect-logs.yml
+++ b/toci-quickstart/config/collect-logs.yml
@@ -1,3 +1,4 @@
1---
1# Collect logs settings 2# Collect logs settings
2 3
3# artcl_tar_gz: true 4# artcl_tar_gz: true
diff --git a/toci-quickstart/config/testenv/multinode-rdocloud.yml b/toci-quickstart/config/testenv/multinode-rdocloud.yml
index 8040389..b4935cd 100644
--- a/toci-quickstart/config/testenv/multinode-rdocloud.yml
+++ b/toci-quickstart/config/testenv/multinode-rdocloud.yml
@@ -1,3 +1,4 @@
1---
1# TRIPLEO-CI environment settings 2# TRIPLEO-CI environment settings
2undercloud_user: "{{ lookup('env','USER') }}" 3undercloud_user: "{{ lookup('env','USER') }}"
3non_root_user: "{{ undercloud_user }}" 4non_root_user: "{{ undercloud_user }}"
diff --git a/toci-quickstart/config/testenv/ovb.yml b/toci-quickstart/config/testenv/ovb.yml
index e55019b..6f3d906 100644
--- a/toci-quickstart/config/testenv/ovb.yml
+++ b/toci-quickstart/config/testenv/ovb.yml
@@ -1,3 +1,4 @@
1---
1undercloud_type: ovb 2undercloud_type: ovb
2use_testenv_broker: true 3use_testenv_broker: true
3build_test_packages: true 4build_test_packages: true
diff --git a/toci_quickstart.sh b/toci_quickstart.sh
index f5c4719..9636236 100755
--- a/toci_quickstart.sh
+++ b/toci_quickstart.sh
@@ -151,16 +151,16 @@ else
151 for playbook in $PLAYBOOKS; do 151 for playbook in $PLAYBOOKS; do
152 echo "${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}" 152 echo "${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}"
153 run_with_timeout $START_JOB_TIME $QUICKSTART_INSTALL_CMD \ 153 run_with_timeout $START_JOB_TIME $QUICKSTART_INSTALL_CMD \
154 "${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}" \ 154 "${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}" \
155 $NODES_ARGS \ 155 $NODES_ARGS \
156 $FEATURESET_CONF \ 156 $FEATURESET_CONF \
157 $ENV_VARS \ 157 $ENV_VARS \
158 $EXTRA_VARS \ 158 $EXTRA_VARS \
159 $VXLAN_VARS \ 159 $VXLAN_VARS \
160 $DEFAULT_ARGS \ 160 $DEFAULT_ARGS \
161 --extra-vars ci_job_end_time=$(( START_JOB_TIME + REMAINING_TIME*60 )) \ 161 --extra-vars ci_job_end_time=$(( START_JOB_TIME + REMAINING_TIME*60 )) \
162 $LOCAL_WORKING_DIR/playbooks/$playbook "${PLAYBOOKS_ARGS[$playbook]:-}" \ 162 $LOCAL_WORKING_DIR/playbooks/$playbook "${PLAYBOOKS_ARGS[$playbook]:-}" \
163 2>&1 | tee -a $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$? 163 2>&1 | tee -a $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$?
164 164
165 # Print status of playbook run 165 # Print status of playbook run
166 [[ "$exit_value" == 0 ]] && echo "Playbook run of $playbook passed successfully" 166 [[ "$exit_value" == 0 ]] && echo "Playbook run of $playbook passed successfully"
diff --git a/tox.ini b/tox.ini
index a1361cd..99ada4f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -18,7 +18,8 @@ commands = pyflakes setup.py scripts
18[testenv:linters] 18[testenv:linters]
19basepython = python3 19basepython = python3
20whitelist_externals = bash 20whitelist_externals = bash
21commands = flake8 --max-line-length 80 {toxinidir} {posargs} 21commands = python -m pre_commit run --source HEAD^ --origin HEAD
22
22 23
23# deprecated: use linters instead. kept only as a convenience alias 24# deprecated: use linters instead. kept only as a convenience alias
24[testenv:pep8] 25[testenv:pep8]
diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml
index ec8fd7b..0e489b1 100644
--- a/zuul.d/layout.yaml
+++ b/zuul.d/layout.yaml
@@ -55,8 +55,8 @@
55 gate: 55 gate:
56 queue: tripleo 56 queue: tripleo
57 jobs: 57 jobs:
58 # Don't put a files section on the linters job, otherwise no 58 # Don't put a files section on the linters job, otherwise no
59 # jobs might be defined and nothing can merge in this repo. 59 # jobs might be defined and nothing can merge in this repo.
60 - openstack-tox-linters 60 - openstack-tox-linters
61 - openstack-tox-py27: 61 - openstack-tox-py27:
62 files: 62 files:
diff --git a/zuul.d/nodesets.yaml b/zuul.d/nodesets.yaml
index 71b1650..2708d12 100644
--- a/zuul.d/nodesets.yaml
+++ b/zuul.d/nodesets.yaml
@@ -1,3 +1,4 @@
1---
1- nodeset: 2- nodeset:
2 name: two-centos-7-nodes 3 name: two-centos-7-nodes
3 nodes: 4 nodes: