Skip to content

Commit

Permalink
tests: test podman against atomic os instead rhel8
Browse files Browse the repository at this point in the history
the rhel8 image used is an outdated beta version, it is not worth it to
maintain this image upstream, since it's possible to test podman with a
newer version of centos/atomic-host image.

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits authored and dsavineau committed Jun 4, 2019
1 parent 2d375e1 commit a78fb20
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 185 deletions.
1 change: 0 additions & 1 deletion roles/ceph-container-common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: include prerequisites.yml
include_tasks: prerequisites.yml
when: not is_atomic

- name: get docker version
block:
Expand Down
14 changes: 13 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
import os


def str_to_bool(val):
try:
val = val.lower()
except AttributeError:
val = str(val).lower()
if val == 'true':
return True
elif val == 'false':
return False
else:
raise ValueError("Invalid input value: %s" % val)

@pytest.fixture(scope="module")
def setup(host):
cluster_address = ""
Expand Down Expand Up @@ -59,7 +71,7 @@ def setup(host):

if docker:
container_binary = "docker"
if docker and host.exists("podman") and ansible_distribution in ["Fedora", "RedHat"]: # noqa E501
if docker and str_to_bool(os.environ.get('IS_PODMAN', False)): # noqa E501
container_binary = "podman"

data = dict(
Expand Down
1 change: 0 additions & 1 deletion tests/functional/ooo_rhel8/Vagrantfile

This file was deleted.

1 change: 0 additions & 1 deletion tests/functional/ooo_rhel8/ceph-override.json

This file was deleted.

39 changes: 0 additions & 39 deletions tests/functional/ooo_rhel8/group_vars/all

This file was deleted.

22 changes: 0 additions & 22 deletions tests/functional/ooo_rhel8/group_vars/clients

This file was deleted.

3 changes: 0 additions & 3 deletions tests/functional/ooo_rhel8/group_vars/iscsigws

This file was deleted.

10 changes: 0 additions & 10 deletions tests/functional/ooo_rhel8/group_vars/mons

This file was deleted.

10 changes: 0 additions & 10 deletions tests/functional/ooo_rhel8/group_vars/osds

This file was deleted.

7 changes: 0 additions & 7 deletions tests/functional/ooo_rhel8/group_vars/rgws

This file was deleted.

30 changes: 0 additions & 30 deletions tests/functional/ooo_rhel8/hosts

This file was deleted.

33 changes: 0 additions & 33 deletions tests/functional/ooo_rhel8/vagrant_variables.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/functional/podman/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ docker: True

containerized_deployment: True
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'ens1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.30.0/24"
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/podman/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ rbd-mirror0
[iscsigws]
iscsi-gw0

[all:vars]
ansible_python_interpreter=/usr/bin/python3
#[all:vars]
#ansible_python_interpreter=/usr/bin/python3
2 changes: 1 addition & 1 deletion tests/functional/podman/vagrant_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cluster_subnet: 192.168.31
# set 1024 for CentOS
memory: 1024

vagrant_box: fedora/29-atomic-host
vagrant_box: centos/atomic-host
# The sync directory changes based on vagrant box
# Set to /home/vagrant/sync for Centos/7, /home/{ user }/vagrant for openstack and defaults to /vagrant
#vagrant_sync_dir: /home/vagrant/sync
Expand Down
14 changes: 0 additions & 14 deletions tests/functional/simulate_rhel8.yml

This file was deleted.

74 changes: 74 additions & 0 deletions tox-podman.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[tox]
envlist = dev-centos-container-podman

skipsdist = True

[testenv]
whitelist_externals =
vagrant
bash
pip
sleep
rm
passenv=*
sitepackages=True
setenv=
ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config
ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
ANSIBLE_ACTION_PLUGINS = {toxinidir}/plugins/actions
ANSIBLE_CALLBACK_PLUGINS = {toxinidir}/plugins/callback
ANSIBLE_CALLBACK_WHITELIST = profile_tasks
ANSIBLE_KEEP_REMOTE_FILES = 1
ANSIBLE_CACHE_PLUGIN = memory
ANSIBLE_GATHERING = implicit
# only available for ansible >= 2.5
ANSIBLE_STDOUT_CALLBACK = yaml
# Set the vagrant box image to use
CEPH_ANSIBLE_VAGRANT_BOX = centos/atomic-host

# Set the ansible inventory host file to be used according to which distrib we are running on
INVENTORY = {env:_INVENTORY:hosts}
PLAYBOOK = site-docker.yml.sample
PURGE_PLAYBOOK = purge-docker-cluster.yml
IS_PODMAN = TRUE
CEPH_STABLE_RELEASE = nautilus

deps= -r{toxinidir}/tests/requirements.txt
changedir= {toxinidir}/tests/functional/podman

commands=
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}

# configure lvm
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml

ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml

ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \
fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
copy_admin_key={env:COPY_ADMIN_KEY:False} \
container_binary=podman \
container_package_name=podman \
container_service_name=podman \
container_binding_name=podman \
"

# wait 30sec for services to be ready
sleep 30
# test cluster state using ceph-ansible tests
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
# wait 30sec for services to be ready

# reboot all vms
ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml

# wait 30sec for services to be ready
# retest to ensure cluster came back up correctly after rebooting
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests

vagrant destroy -f
10 changes: 1 addition & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[tox]
envlist = {dev,rhcs}-{centos,ubuntu}-{container,non_container}-{all_daemons,collocation,lvm_osds,shrink_mon,shrink_osd,lvm_batch,add_mons,add_osds,add_mgrs,add_mdss,add_rbdmirrors,add_rgws,rgw_multisite,purge,storage_inventory,lvm_auto_discovery}
{dev,rhcs}-{centos,ubuntu}-container-{ooo_collocation,podman}
{dev,rhcs}-{centos,ubuntu}-container-{ooo_collocation}
{dev,rhcs}-{centos,ubuntu}-non_container-{switch_to_containers}
dev-rhel-container-podman
infra_lv_create
migrate_ceph_disk_to_ceph_volume

Expand Down Expand Up @@ -347,10 +346,7 @@ setenv=
# Set the vagrant box image to use
centos-non_container: CEPH_ANSIBLE_VAGRANT_BOX = centos/7
centos-container: CEPH_ANSIBLE_VAGRANT_BOX = centos/atomic-host
podman: CEPH_ANSIBLE_VAGRANT_BOX = fedora/29-atomic-host
ubuntu: CEPH_ANSIBLE_VAGRANT_BOX = guits/ubuntu-bionic64
dev-rhel-container-podman: CEPH_ANSIBLE_VAGRANT_BOX = rhel8-x86_64
dev-rhel-container-podman: CEPH_ANSIBLE_VAGRANT_BOX_URL = http://drop.front.sepia.ceph.com/vagrant/rhel8-x86_64.box

# Set the ansible inventory host file to be used according to which distrib we are running on
ubuntu: _INVENTORY = hosts-ubuntu
Expand All @@ -359,7 +355,6 @@ setenv=
container: PLAYBOOK = site-docker.yml.sample
container: PURGE_PLAYBOOK = purge-docker-cluster.yml
storage_inventory: COPY_ADMIN_KEY = True
podman: PLAYBOOK = site-docker.yml.sample
non_container: PLAYBOOK = site.yml.sample
shrink_mon: MON_TO_KILL = mon2
shrink_osd: COPY_ADMIN_KEY = True
Expand Down Expand Up @@ -399,7 +394,6 @@ changedir=
add_rbdmirrors: {toxinidir}/tests/functional/add-rbdmirrors{env:CONTAINER_DIR:}
add_rgws: {toxinidir}/tests/functional/add-rgws{env:CONTAINER_DIR:}
rgw_multisite: {toxinidir}/tests/functional/rgw-multisite{env:CONTAINER_DIR:}
podman: {toxinidir}/tests/functional/podman
storage_inventory: {toxinidir}/tests/functional/lvm-osds{env:CONTAINER_DIR:}
lvm_auto_discovery: {toxinidir}/tests/functional/lvm-auto-discovery{env:CONTAINER_DIR:}

Expand All @@ -413,8 +407,6 @@ commands=
# configure lvm
!lvm_batch-!lvm_auto_discovery: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml

podman: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/simulate_rhel8.yml

rhcs: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/rhcs_setup.yml --extra-vars "ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} repo_url={env:REPO_URL:} rhel7_repo_url={env:RHEL7_REPO_URL:}" --skip-tags "vagrant_setup"

ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
Expand Down

0 comments on commit a78fb20

Please sign in to comment.