Skip to content

Commit

Permalink
system-containers: use continue-on-failure model (projectatomic#400)
Browse files Browse the repository at this point in the history
This updates the `system-containers` suite to use the
'continue-on-failure` model that has been used for other test suites.
  • Loading branch information
Micah Abbott authored and mike-nguyen committed May 23, 2018
1 parent c0f37d5 commit b834477
Show file tree
Hide file tree
Showing 11 changed files with 668 additions and 620 deletions.
13 changes: 13 additions & 0 deletions tests/system-containers/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# vim: set ft=ansible:
#
- import_role:
name: atomic_images_delete_all
tags:
- atomic_images_delete_all

- when: ansible_distribution == 'RedHat'
import_role:
name: redhat_unsubscribe
tags:
- redhat_unsubscribe
99 changes: 99 additions & 0 deletions tests/system-containers/flannel_etcd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
# vim: set ft=ansible:
#

- name: Check for etcd rpm
command: rpm -q etcd
register: rpm_etcd
ignore_errors: true

- name: Check for flannel rpm
command: rpm -q flannel
register: rpm_flannel
ignore_errors: true

- name: Stop flanneld server if flannel rpm present
when: rpm_flannel.rc == 0
service:
name: flanneld
state: stopped
enabled: false

- name: Stop etcd service if etcd rpm present
when: rpm_etcd.rc == 0
service:
name: etcd
state: stopped
enabled: false

- name: Install etcd
command: >
atomic install --system
--name=etcd
{{ etcd_image }}
register: ai_etcd
retries: 5
delay: 60
until: ai_etcd|success

- name: Start etcd
command: systemctl start etcd

- name: Verify etcd is active
command: systemctl is-active etcd
register: etcd_output
failed_when: "'active' not in etcd_output.stdout"

- name: Wait for etcd port to open
wait_for:
port: 2379
timeout: 30

- name: Configure etcd
command: >
runc exec etcd etcdctl
set /atomic.io/network/config '{"Network":"172.17.0.0/16"}'
- name: Install flannel
command: >
atomic install --system
--name=flannel
{{ flannel_image }}
register: ai_flannel
retries: 5
delay: 60
until: ai_flannel|success

- name: Start flannel
command: systemctl start flannel

- name: Verify flannel service is active
command: systemctl is-active flannel
register: flannel_output
failed_when: "'active' not in flannel_output.stdout"

- import_role:
name: atomic_system_uninstall
vars:
asu_name: "{{ etcd_name }}"

- import_role:
name: atomic_system_uninstall
vars:
asu_name: "{{ flannel_name }}"

# Upstream issue with flannel container installation stopping docker
# https://github.com/projectatomic/atomic-system-containers/issues/23
- name: Start docker
when: "'gscrivano' in etcd_image"
command: systemctl start docker

- import_role:
name: atomic_system_uninstall_verify
vars:
asuv_image: "{{ etcd_image }}"

- import_role:
name: atomic_system_uninstall_verify
vars:
asuv_image: "{{ flannel_image }}"
29 changes: 29 additions & 0 deletions tests/system-containers/install_uninstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# vim: set ft=ansible:
#
# - Verify system containers can be installed through atomic command
# - Verify system containers can be uninstalled through the atomic command
# - Verify user can specify name for system containers
# - Verify system containers can be listed

- import_role:
name: atomic_system_install
vars:
asi_image: "{{ g_hw_image }}"

- import_role:
name: atomic_system_install_verify
vars:
asiv_image: "{{ g_hw_image }}"

- import_role:
name: atomic_system_uninstall
vars:
asu_name: "{{ g_hw_name }}"

# uninstall can only be done by name because multiple system containers can
# use the same image https://github.com/projectatomic/atomic/issues/705
- import_role:
name: atomic_system_uninstall_verify
vars:
asuv_image: "{{ g_hw_image }}"
Loading

0 comments on commit b834477

Please sign in to comment.