Import beaker jobs into p-o-i
Import legacy jobs from openstack-zuul-jobs into p-o-i. Change-Id: I8f4b24cfd5fa6d91758f95228f823d82839c3366
This commit is contained in:
parent
70112e5f5f
commit
c82fae7eed
39
.zuul.yaml
39
.zuul.yaml
@ -349,6 +349,7 @@
|
||||
- ^metadata.json$
|
||||
- ^releasenotes/.*$
|
||||
- ^test-requirements.txt$
|
||||
- ^spec/acceptance/.*$
|
||||
|
||||
- job:
|
||||
name: puppet-openstack-unit-4.8-centos-7
|
||||
@ -392,3 +393,41 @@
|
||||
templates:
|
||||
- puppet-openstack-check-jobs
|
||||
- puppet-openstack-integration-jobs-all
|
||||
|
||||
- job:
|
||||
name: puppet-openstack-beaker-run-base
|
||||
parent: puppet-openstack-integration-base
|
||||
pre-run: playbooks/prepare-node-beaker.yaml
|
||||
post-run: playbooks/upload-logs.yaml
|
||||
run: playbooks/run-beaker-tests.yaml
|
||||
timeout: 5400
|
||||
irrelevant-files:
|
||||
- ^.*\.md$
|
||||
- ^spec/unit/.*$
|
||||
- ^spec/classes/.*$
|
||||
- ^test-requirements.txt$
|
||||
|
||||
- job:
|
||||
name: puppet-openstack-beaker-centos-7
|
||||
parent: puppet-openstack-beaker-run-base
|
||||
nodeset: centos-7
|
||||
vars:
|
||||
nodepool_type: centos7
|
||||
|
||||
- job:
|
||||
name: puppet-openstack-beaker-xenial
|
||||
parent: puppet-openstack-beaker-run-base
|
||||
nodeset: ubuntu-xenial
|
||||
vars:
|
||||
nodepool_type: xenial
|
||||
|
||||
- project-template:
|
||||
name: puppet-openstack-beaker-jobs
|
||||
check:
|
||||
jobs:
|
||||
- puppet-openstack-beaker-centos-7
|
||||
- puppet-openstack-beaker-xenial
|
||||
gate:
|
||||
jobs:
|
||||
- puppet-openstack-beaker-centos-7
|
||||
- puppet-openstack-beaker-xenial
|
||||
|
35
playbooks/prepare-node-beaker.yaml
Normal file
35
playbooks/prepare-node-beaker.yaml
Normal file
@ -0,0 +1,35 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
CLONEMAP=`mktemp`
|
||||
function cleanup {
|
||||
# In cases where zuul-cloner is aborted during a git
|
||||
# clone operation, git will remove the git work tree in
|
||||
# its cleanup. The work tree in these jobs is the
|
||||
# workspace directory, which means that subsequent
|
||||
# jenkins post-build actions can not run because the
|
||||
# workspace has been removed.
|
||||
# To reduce the likelihood of this having an impact,
|
||||
# recreate the workspace directory if needed
|
||||
mkdir -p $WORKSPACE
|
||||
rm -f $CLONEMAP
|
||||
}
|
||||
trap cleanup EXIT
|
||||
cat > $CLONEMAP << EOF
|
||||
clonemap:
|
||||
- name: $ZUUL_PROJECT
|
||||
dest: .
|
||||
- name: openstack/puppet-openstack-integration
|
||||
dest: openstack/puppet-openstack-integration
|
||||
EOF
|
||||
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
|
||||
git://git.openstack.org $ZUUL_PROJECT openstack/puppet-openstack-integration
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- include_role:
|
||||
name: bindep
|
59
playbooks/run-beaker-tests.yaml
Normal file
59
playbooks/run-beaker-tests.yaml
Normal file
@ -0,0 +1,59 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Prepare ssh config on the host to run beaker
|
||||
shell:
|
||||
cmd: |
|
||||
echo "" | sudo tee -a /etc/ssh/sshd_config
|
||||
echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config
|
||||
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
|
||||
echo "" | sudo tee -a /etc/ssh/sshd_config
|
||||
echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config
|
||||
echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
|
||||
mkdir -p .ssh
|
||||
ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P ""
|
||||
sudo mkdir -p /root/.ssh
|
||||
cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
|
||||
if [ -f /usr/bin/yum ]; then
|
||||
sudo systemctl reload sshd
|
||||
elif [ -f /usr/bin/apt-get ]; then
|
||||
sudo service ssh restart
|
||||
fi
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
- name: Run beaker
|
||||
shell:
|
||||
cmd: |
|
||||
trap "{{ ansible_user_dir }}/workspace/openstack/puppet-openstack-integration/copy_logs.sh" EXIT
|
||||
export BEAKER_set=nodepool-{{ nodepool_type }}
|
||||
export BEAKER_debug=yes
|
||||
export BEAKER_color=no
|
||||
if [ -f Modulefile -o -f metadata.json ]; then
|
||||
if [ -f Modulefile ]; then
|
||||
MODULE=$(awk '/^name/ {print $NF}' Modulefile |tr -d \"\')
|
||||
elif [ -f metadata.json ]; then
|
||||
MODULE=$(python -c 'import json;print json.load(open("metadata.json"))["name"]')
|
||||
fi
|
||||
if [ -z "$MODULE" ]; then
|
||||
echo "Module name not defined in Modulefile or metadata.json"
|
||||
else
|
||||
mkdir -p "$MODULE"
|
||||
rsync -a --exclude="$MODULE" --exclude ".*" . "$MODULE"
|
||||
cd "$MODULE"
|
||||
fi
|
||||
fi
|
||||
mkdir .bundled_gems
|
||||
export GEM_HOME=`pwd`/.bundled_gems
|
||||
if [ -f Gemfile ]; then
|
||||
gem install bundler --no-rdoc --no-ri --verbose
|
||||
$GEM_HOME/bin/bundle install --without system_tests --retry 3
|
||||
$GEM_HOME/bin/bundle exec rspec spec/acceptance
|
||||
else
|
||||
gem install rake -n ./.bundled_gems/
|
||||
gem install beaker-rspec
|
||||
gem install puppetlabs_spec_helper
|
||||
./.bundled_gems/rake acceptance 2>&1
|
||||
fi
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
executable: /bin/bash
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
Loading…
x
Reference in New Issue
Block a user