integration: Use vars_files in plays
It's unsightly and hard to maintain collections of references and long lists across multiple playbooks/include files. Centralize them all in ``vars.yml``, then include that in all plays. Minor: Update all files with a newline at the start and end. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
a30a118fe6
commit
493a72bbc9
13 changed files with 101 additions and 86 deletions
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: clone bats source repo
|
- name: clone bats source repo
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/sstephenson/bats.git"
|
repo: "https://github.com/sstephenson/bats.git"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: stat the expected cri-o directory
|
- name: stat the expected cri-o directory
|
||||||
stat:
|
stat:
|
||||||
path: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
path: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: clone cri-tools source repo
|
- name: clone cri-tools source repo
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/kubernetes-incubator/cri-tools.git"
|
repo: "https://github.com/kubernetes-incubator/cri-tools.git"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: clone kubernetes source repo
|
- name: clone kubernetes source repo
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/runcom/kubernetes.git"
|
repo: "https://github.com/runcom/kubernetes.git"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: clone plugins source repo
|
- name: clone plugins source repo
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/containernetworking/plugins.git"
|
repo: "https://github.com/containernetworking/plugins.git"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: clone runc source repo
|
- name: clone runc source repo
|
||||||
git:
|
git:
|
||||||
repo: "https://github.com/opencontainers/runc.git"
|
repo: "https://github.com/opencontainers/runc.git"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: enable and start CRI-O
|
- name: enable and start CRI-O
|
||||||
systemd:
|
systemd:
|
||||||
name: crio
|
name: crio
|
||||||
|
@ -31,11 +32,6 @@
|
||||||
retries: 100
|
retries: 100
|
||||||
delay: 30
|
delay: 30
|
||||||
|
|
||||||
- name: Buffer location for e2e output and reports
|
|
||||||
set_fact:
|
|
||||||
# N/B: This need manual coordination with results.yml
|
|
||||||
artifacts: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/artifacts"
|
|
||||||
|
|
||||||
- name: ensure directory exists for e2e reports
|
- name: ensure directory exists for e2e reports
|
||||||
file:
|
file:
|
||||||
path: "{{ artifacts }}"
|
path: "{{ artifacts }}"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: set up GOPATH if it is not already set
|
- name: set up GOPATH if it is not already set
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/environment
|
dest: /etc/environment
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- hosts: all
|
- hosts: all
|
||||||
remote_user: root
|
remote_user: root
|
||||||
vars:
|
vars_files:
|
||||||
xunit: false
|
- "{{ playbook_dir }}/vars.yml"
|
||||||
tags:
|
tags:
|
||||||
- setup
|
- setup
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
remote_user: root
|
remote_user: root
|
||||||
vars:
|
vars_files:
|
||||||
xunit: false
|
- "{{ playbook_dir }}/vars.yml"
|
||||||
tags:
|
tags:
|
||||||
- integration
|
- integration
|
||||||
- e2e
|
- e2e
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
remote_user: root
|
remote_user: root
|
||||||
vars:
|
vars_files:
|
||||||
xunit: false
|
- "{{ playbook_dir }}/vars.yml"
|
||||||
tags:
|
tags:
|
||||||
- integration
|
- integration
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -49,6 +49,8 @@
|
||||||
|
|
||||||
- hosts: all
|
- hosts: all
|
||||||
remote_user: root
|
remote_user: root
|
||||||
|
vars_files:
|
||||||
|
- "{{ playbook_dir }}/vars.yml"
|
||||||
tags:
|
tags:
|
||||||
- e2e
|
- e2e
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -2,14 +2,9 @@
|
||||||
# vim-syntax: ansible
|
# vim-syntax: ansible
|
||||||
|
|
||||||
- hosts: '{{ hosts | default("all") }}'
|
- hosts: '{{ hosts | default("all") }}'
|
||||||
|
vars_files:
|
||||||
|
- "{{ playbook_dir }}/vars.yml"
|
||||||
vars:
|
vars:
|
||||||
# Paths use rsync 'source' conventions
|
|
||||||
crio_integration_filepath: "/root/src/github.com/kubernetes-incubator/cri-o/testout.txt"
|
|
||||||
# N/B: This needs coordination with e2e.yml
|
|
||||||
crio_node_e2e_filepath: "/root/go-tools/src/k8s.io/kubernetes/artifacts/" # everything
|
|
||||||
# Treat empty env. var as "undefined and use default()
|
|
||||||
result_dest_basedir: '{{ lookup("env","WORKSPACE") |
|
|
||||||
default(playbook_dir, True) }}/artifacts'
|
|
||||||
_result_filepaths: [] # do not use
|
_result_filepaths: [] # do not use
|
||||||
_dstfnbuff: [] # do not use
|
_dstfnbuff: [] # do not use
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: register a repo for Golang
|
- name: register a repo for Golang
|
||||||
yum_repository:
|
yum_repository:
|
||||||
name: 'centos-paas-sig-openshift-origin37-rpms'
|
name: 'centos-paas-sig-openshift-origin37-rpms'
|
||||||
|
@ -14,61 +15,7 @@
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
with_items: "{{ rpm_pkgs }}"
|
||||||
- btrfs-progs-devel
|
|
||||||
- container-selinux
|
|
||||||
- curl
|
|
||||||
- device-mapper-devel
|
|
||||||
- expect
|
|
||||||
- findutils
|
|
||||||
- gcc
|
|
||||||
- git
|
|
||||||
- glib2-devel
|
|
||||||
- glibc-devel
|
|
||||||
- glibc-static
|
|
||||||
- golang
|
|
||||||
- gpgme-devel
|
|
||||||
- hostname
|
|
||||||
- iproute
|
|
||||||
- iptables
|
|
||||||
- krb5-workstation
|
|
||||||
- libassuan-devel
|
|
||||||
- libffi-devel
|
|
||||||
- libgpg-error-devel
|
|
||||||
- libguestfs-tools
|
|
||||||
- libseccomp-devel
|
|
||||||
- libvirt-client
|
|
||||||
- libvirt-python
|
|
||||||
- libxml2-devel
|
|
||||||
- libxslt-devel
|
|
||||||
- make
|
|
||||||
- mlocate
|
|
||||||
- nfs-utils
|
|
||||||
- nmap-ncat
|
|
||||||
- npm
|
|
||||||
- oci-register-machine
|
|
||||||
- oci-systemd-hook
|
|
||||||
- oci-umount
|
|
||||||
- openssl
|
|
||||||
- openssl-devel
|
|
||||||
- ostree-devel
|
|
||||||
- pkgconfig
|
|
||||||
- python
|
|
||||||
- python2-boto
|
|
||||||
- python2-crypto
|
|
||||||
- python2-mock
|
|
||||||
- python-click
|
|
||||||
- python-devel
|
|
||||||
- python-virtualenv
|
|
||||||
- PyYAML
|
|
||||||
- redhat-rpm-config
|
|
||||||
- rpcbind
|
|
||||||
- rsync
|
|
||||||
- sed
|
|
||||||
- skopeo-containers
|
|
||||||
- socat
|
|
||||||
- tar
|
|
||||||
- wget
|
|
||||||
async: 600
|
async: 600
|
||||||
poll: 10
|
poll: 10
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Change test_runner.sh to use bats xunit output
|
- name: Change test_runner.sh to use bats xunit output
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/test_runner.sh"
|
dest: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/test_runner.sh"
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
|
|
||||||
- name: set extra shell for non-xunit tests
|
- name: set extra shell for non-xunit tests
|
||||||
set_fact:
|
set_fact:
|
||||||
extra_shell_suffix: " >testout.txt 2>&1"
|
extra_shell_suffix: " &> {{ artifacts }}/testout.txt"
|
||||||
when: not xunit
|
when: not xunit
|
||||||
|
|
||||||
- name: run integration tests
|
- name: run integration tests
|
||||||
|
@ -35,13 +36,13 @@
|
||||||
|
|
||||||
- name: Make testing output directory
|
- name: Make testing output directory
|
||||||
file:
|
file:
|
||||||
path: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/reports"
|
path: "{{ artifacts }}"
|
||||||
state: directory
|
state: directory
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
when: xunit
|
when: xunit
|
||||||
|
|
||||||
- name: Move all xunit files into one dir to scp
|
- name: Move all xunit files into one dir to scp
|
||||||
shell: "mv {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/TestReport-bats*.xml {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/reports/"
|
shell: "mv {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/TestReport-bats*.xml {{ artifacts }}"
|
||||||
when: xunit
|
when: xunit
|
||||||
|
|
||||||
- name: ensure we fail on bad tests
|
- name: ensure we fail on bad tests
|
||||||
|
|
67
contrib/test/integration/vars.yml
Normal file
67
contrib/test/integration/vars.yml
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# Enable using BATS to output integration-test xunit output (FIXME: broken? Kill it?)
|
||||||
|
xunit: false
|
||||||
|
|
||||||
|
rpm_pkgs:
|
||||||
|
- btrfs-progs-devel
|
||||||
|
- container-selinux
|
||||||
|
- curl
|
||||||
|
- device-mapper-devel
|
||||||
|
- expect
|
||||||
|
- findutils
|
||||||
|
- gcc
|
||||||
|
- git
|
||||||
|
- glib2-devel
|
||||||
|
- glibc-devel
|
||||||
|
- glibc-static
|
||||||
|
- golang
|
||||||
|
- gpgme-devel
|
||||||
|
- hostname
|
||||||
|
- iproute
|
||||||
|
- iptables
|
||||||
|
- krb5-workstation
|
||||||
|
- libassuan-devel
|
||||||
|
- libffi-devel
|
||||||
|
- libgpg-error-devel
|
||||||
|
- libguestfs-tools
|
||||||
|
- libseccomp-devel
|
||||||
|
- libvirt-client
|
||||||
|
- libvirt-python
|
||||||
|
- libxml2-devel
|
||||||
|
- libxslt-devel
|
||||||
|
- make
|
||||||
|
- mlocate
|
||||||
|
- nfs-utils
|
||||||
|
- nmap-ncat
|
||||||
|
- npm
|
||||||
|
- oci-register-machine
|
||||||
|
- oci-systemd-hook
|
||||||
|
- oci-umount
|
||||||
|
- openssl
|
||||||
|
- openssl-devel
|
||||||
|
- ostree-devel
|
||||||
|
- pkgconfig
|
||||||
|
- python
|
||||||
|
- python2-boto
|
||||||
|
- python2-crypto
|
||||||
|
- python2-mock
|
||||||
|
- python-click
|
||||||
|
- python-devel
|
||||||
|
- python-virtualenv
|
||||||
|
- PyYAML
|
||||||
|
- redhat-rpm-config
|
||||||
|
- rpcbind
|
||||||
|
- rsync
|
||||||
|
- sed
|
||||||
|
- skopeo-containers
|
||||||
|
- socat
|
||||||
|
- tar
|
||||||
|
- wget
|
||||||
|
|
||||||
|
# For results.yml Paths use rsync 'source' conventions
|
||||||
|
artifacts: "/tmp/artifacts" # Base-directory for collection
|
||||||
|
crio_integration_filepath: "{{ artifacts }}/testout.txt"
|
||||||
|
crio_node_e2e_filepath: "{{ artifacts }}/junit_01.xml"
|
||||||
|
result_dest_basedir: '{{ lookup("env","WORKSPACE") |
|
||||||
|
default(playbook_dir, True) }}/artifacts'
|
Loading…
Reference in a new issue