]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: add external_clients scenario
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 30 Jan 2020 12:00:47 +0000 (13:00 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Feb 2020 09:20:19 +0000 (10:20 +0100)
This commit adds a new 'external ceph clients' scenario.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 641729357e5c8bc4dbf90b5c4f7b20e1d3d51f7d)

14 files changed:
tests/functional/external_clients/Vagrantfile [new symlink]
tests/functional/external_clients/ceph-override.json [new symlink]
tests/functional/external_clients/container/Vagrantfile [new symlink]
tests/functional/external_clients/container/ceph-override.json [new symlink]
tests/functional/external_clients/container/external_clients-hosts [new file with mode: 0644]
tests/functional/external_clients/container/group_vars/all [new file with mode: 0644]
tests/functional/external_clients/container/hosts [new file with mode: 0644]
tests/functional/external_clients/container/vagrant_variables.yml [new file with mode: 0644]
tests/functional/external_clients/external_clients-hosts [new file with mode: 0644]
tests/functional/external_clients/group_vars/all [new file with mode: 0644]
tests/functional/external_clients/hosts [new file with mode: 0644]
tests/functional/external_clients/hosts-ubuntu [new symlink]
tests/functional/external_clients/vagrant_variables.yml [new file with mode: 0644]
tox-external_clients.ini [new file with mode: 0644]

diff --git a/tests/functional/external_clients/Vagrantfile b/tests/functional/external_clients/Vagrantfile
new file mode 120000 (symlink)
index 0000000..706a5bb
--- /dev/null
@@ -0,0 +1 @@
+../../../Vagrantfile
\ No newline at end of file
diff --git a/tests/functional/external_clients/ceph-override.json b/tests/functional/external_clients/ceph-override.json
new file mode 120000 (symlink)
index 0000000..fe2ff40
--- /dev/null
@@ -0,0 +1 @@
+../all_daemons/ceph-override.json
\ No newline at end of file
diff --git a/tests/functional/external_clients/container/Vagrantfile b/tests/functional/external_clients/container/Vagrantfile
new file mode 120000 (symlink)
index 0000000..16076e4
--- /dev/null
@@ -0,0 +1 @@
+../../../../Vagrantfile
\ No newline at end of file
diff --git a/tests/functional/external_clients/container/ceph-override.json b/tests/functional/external_clients/container/ceph-override.json
new file mode 120000 (symlink)
index 0000000..8417cc0
--- /dev/null
@@ -0,0 +1 @@
+../../all_daemons/ceph-override.json
\ No newline at end of file
diff --git a/tests/functional/external_clients/container/external_clients-hosts b/tests/functional/external_clients/container/external_clients-hosts
new file mode 100644 (file)
index 0000000..5378903
--- /dev/null
@@ -0,0 +1,3 @@
+[clients]
+client0
+client1
\ No newline at end of file
diff --git a/tests/functional/external_clients/container/group_vars/all b/tests/functional/external_clients/container/group_vars/all
new file mode 100644 (file)
index 0000000..1b45da8
--- /dev/null
@@ -0,0 +1,38 @@
+---
+# this is only here to let the CI tests know
+# that this scenario is using docker
+docker: True
+
+containerized_deployment: True
+monitor_interface: "{{ 'eth1' 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.31.0/24"
+cluster_network: "192.168.32.0/24"
+rgw_override_bucket_index_max_shards: 16
+rgw_bucket_default_quota_max_objects: 1638400
+openstack_config: True
+ceph_conf_overrides:
+  global:
+    osd_pool_default_pg_num: 8
+    osd_pool_default_size: 1
+handler_health_mon_check_delay: 10
+handler_health_osd_check_delay: 10
+rgw_create_pools:
+  foo:
+    pg_num: 16
+  bar:
+    pg_num: 16
+ceph_osd_docker_run_script_path: /var/tmp
+osd_objectstore: "bluestore"
+osd_scenario: lvm
+lvm_volumes:
+  - data: data-lv1
+    data_vg: test_group
+  - data: data-lv2
+    data_vg: test_group
+    db: journal1
+    db_vg: journals
+fsid: 40358a87-ab6e-4bdc-83db-1d909147861c
+generate_fsid: false
\ No newline at end of file
diff --git a/tests/functional/external_clients/container/hosts b/tests/functional/external_clients/container/hosts
new file mode 100644 (file)
index 0000000..a63f471
--- /dev/null
@@ -0,0 +1,7 @@
+[mons]
+mon0
+mon1
+mon2
+
+[mgrs]
+mon0
diff --git a/tests/functional/external_clients/container/vagrant_variables.yml b/tests/functional/external_clients/container/vagrant_variables.yml
new file mode 100644 (file)
index 0000000..e19fa4f
--- /dev/null
@@ -0,0 +1,60 @@
+---
+
+# DEPLOY CONTAINERIZED DAEMONS
+docker: True
+
+# DEFINE THE NUMBER OF VMS TO RUN
+mon_vms: 3
+osd_vms: 0
+mds_vms: 0
+rgw_vms: 0
+nfs_vms: 0
+rbd_mirror_vms: 0
+client_vms: 3
+iscsi_gw_vms: 0
+mgr_vms: 0
+
+# SUBNETS TO USE FOR THE VMS
+public_subnet: 192.168.31
+cluster_subnet: 192.168.32
+
+# MEMORY
+# set 1024 for CentOS
+memory: 1024
+
+# Disks
+# For libvirt use disks: "[ '/dev/vdb', '/dev/vdc' ]"
+# For CentOS7 use disks: "[ '/dev/sda', '/dev/sdb' ]"
+disks: "[ '/dev/sda', '/dev/sdb' ]"
+
+# VAGRANT BOX
+# Ceph boxes are *strongly* suggested. They are under better control and will
+# not get updated frequently unless required for build systems. These are (for
+# now):
+#
+# * ceph/ubuntu-xenial
+#
+# Ubuntu: ceph/ubuntu-xenial bento/ubuntu-16.04 or ubuntu/trusty64 or ubuntu/wily64
+# CentOS: bento/centos-7.1 or puppetlabs/centos-7.0-64-puppet
+# libvirt CentOS: centos/7
+# parallels Ubuntu: parallels/ubuntu-14.04
+# Debian: deb/jessie-amd64 - be careful the storage controller is named 'SATA Controller'
+# For more boxes have a look at:
+#   - https://atlas.hashicorp.com/boxes/search?utf8=✓&sort=&provider=virtualbox&q=
+#   - https://download.gluster.org/pub/gluster/purpleidea/vagrant/
+vagrant_box: centos/atomic-host
+# client_vagrant_box: centos/7
+#ssh_private_key_path: "~/.ssh/id_rsa"
+# 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
+#vagrant_sync_dir: /
+# Disables synced folder creation. Not needed for testing, will skip mounting
+# the vagrant directory on the remote box regardless of the provider.
+vagrant_disable_synced_folder: true
+# VAGRANT URL
+# This is a URL to download an image from an alternate location.  vagrant_box
+# above should be set to the filename of the image.
+# Fedora virtualbox: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box
+# Fedora libvirt: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-libvirt.box
+# vagrant_box_url: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box
diff --git a/tests/functional/external_clients/external_clients-hosts b/tests/functional/external_clients/external_clients-hosts
new file mode 100644 (file)
index 0000000..5378903
--- /dev/null
@@ -0,0 +1,3 @@
+[clients]
+client0
+client1
\ No newline at end of file
diff --git a/tests/functional/external_clients/group_vars/all b/tests/functional/external_clients/group_vars/all
new file mode 100644 (file)
index 0000000..02d27a2
--- /dev/null
@@ -0,0 +1,36 @@
+---
+containerized_deployment: False
+ceph_origin: repository
+ceph_repository: community
+monitor_interface: "{{ 'eth1' 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
+openstack_config: True
+public_network: "192.168.31.0/24"
+cluster_network: "192.168.32.0/24"
+rgw_override_bucket_index_max_shards: 16
+rgw_bucket_default_quota_max_objects: 1638400
+ceph_conf_overrides:
+  global:
+    osd_pool_default_pg_num: 8
+    osd_pool_default_size: 1
+handler_health_mon_check_delay: 10
+handler_health_osd_check_delay: 10
+ceph_osd_docker_run_script_path: /var/tmp
+osd_objectstore: "bluestore"
+osd_scenario: lvm
+lvm_volumes:
+  - data: data-lv1
+    data_vg: test_group
+  - data: data-lv2
+    data_vg: test_group
+    db: journal1
+    db_vg: journals
+rgw_create_pools:
+  foo:
+    pg_num: 16
+  bar:
+    pg_num: 16
+fsid: 40358a87-ab6e-4bdc-83db-1d909147861c
+generate_fsid: false
\ No newline at end of file
diff --git a/tests/functional/external_clients/hosts b/tests/functional/external_clients/hosts
new file mode 100644 (file)
index 0000000..a63f471
--- /dev/null
@@ -0,0 +1,7 @@
+[mons]
+mon0
+mon1
+mon2
+
+[mgrs]
+mon0
diff --git a/tests/functional/external_clients/hosts-ubuntu b/tests/functional/external_clients/hosts-ubuntu
new file mode 120000 (symlink)
index 0000000..9b0b900
--- /dev/null
@@ -0,0 +1 @@
+hosts
\ No newline at end of file
diff --git a/tests/functional/external_clients/vagrant_variables.yml b/tests/functional/external_clients/vagrant_variables.yml
new file mode 100644 (file)
index 0000000..f3975a6
--- /dev/null
@@ -0,0 +1,56 @@
+---
+# DEFINE THE NUMBER OF VMS TO RUN
+mon_vms: 3
+osd_vms: 0
+mds_vms: 0
+rgw_vms: 0
+nfs_vms: 0
+rbd_mirror_vms: 0
+client_vms: 3
+iscsi_gw_vms: 0
+mgr_vms: 0
+
+# SUBNETS TO USE FOR THE VMS
+public_subnet: 192.168.31
+cluster_subnet: 192.168.32
+
+# MEMORY
+# set 1024 for CentOS
+memory: 1024
+
+# Disks
+# For libvirt use disks: "[ '/dev/vdb', '/dev/vdc' ]"
+# For CentOS7 use disks: "[ '/dev/sda', '/dev/sdb' ]"
+disks: "[ '/dev/sda', '/dev/sdb' ]"
+
+# VAGRANT BOX
+# Ceph boxes are *strongly* suggested. They are under better control and will
+# not get updated frequently unless required for build systems. These are (for
+# now):
+#
+# * ceph/ubuntu-xenial
+#
+# Ubuntu: ceph/ubuntu-xenial bento/ubuntu-16.04 or ubuntu/trusty64 or ubuntu/wily64
+# CentOS: bento/centos-7.1 or puppetlabs/centos-7.0-64-puppet
+# libvirt CentOS: centos/7
+# parallels Ubuntu: parallels/ubuntu-14.04
+# Debian: deb/jessie-amd64 - be careful the storage controller is named 'SATA Controller'
+# For more boxes have a look at:
+#   - https://atlas.hashicorp.com/boxes/search?utf8=✓&sort=&provider=virtualbox&q=
+#   - https://download.gluster.org/pub/gluster/purpleidea/vagrant/
+vagrant_box: centos/atomic-host
+# client_vagrant_box: centos/7
+#ssh_private_key_path: "~/.ssh/id_rsa"
+# 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
+#vagrant_sync_dir: /
+# Disables synced folder creation. Not needed for testing, will skip mounting
+# the vagrant directory on the remote box regardless of the provider.
+vagrant_disable_synced_folder: true
+# VAGRANT URL
+# This is a URL to download an image from an alternate location.  vagrant_box
+# above should be set to the filename of the image.
+# Fedora virtualbox: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box
+# Fedora libvirt: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-libvirt.box
+# vagrant_box_url: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box
diff --git a/tox-external_clients.ini b/tox-external_clients.ini
new file mode 100644 (file)
index 0000000..3b5915f
--- /dev/null
@@ -0,0 +1,68 @@
+[tox]
+envlist = {centos,ubuntu}-{container,non_container}-external_clients
+
+skipsdist = True
+
+[testenv]
+whitelist_externals =
+    vagrant
+    bash
+    git
+    pip
+passenv=*
+setenv=
+  ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey
+  ANSIBLE_CONFIG = {toxinidir}/ansible.cfg
+  ANSIBLE_CALLBACK_WHITELIST = profile_tasks
+  ANSIBLE_CACHE_PLUGIN = memory
+  ANSIBLE_GATHERING = implicit
+  # only available for ansible >= 2.5
+  ANSIBLE_STDOUT_CALLBACK = yaml
+#  non_container: DEV_SETUP = True
+  # 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
+  ubuntu: CEPH_ANSIBLE_VAGRANT_BOX = guits/ubuntu-bionic64
+
+  # Set the ansible inventory host file to be used according to which distrib we are running on
+  ubuntu: _INVENTORY = hosts-ubuntu
+  INVENTORY = {env:_INVENTORY:hosts}
+  container: CONTAINER_DIR = /container
+  container: PLAYBOOK = site-docker.yml.sample
+  non_container: PLAYBOOK = site.yml.sample
+
+deps= -r{toxinidir}/tests/requirements.txt
+changedir={toxinidir}/tests/functional/external_clients{env:CONTAINER_DIR:}
+commands=
+  bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
+  bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
+
+  ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/setup.yml
+
+  # configure lvm
+  ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml
+
+  ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --limit 'all:!clients' --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_stable_release=luminous \
+      ceph_docker_image=ceph/daemon \
+      ceph_docker_image_tag=latest-luminous \
+  "
+
+  ansible-playbook -vv -i {changedir}/external_clients-hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\
+      ireallymeanit=yes \
+      fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \
+      fsid=40358a87-ab6e-4bdc-83db-1d909147861c \
+      external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \
+      generate_fsid=false \
+      ceph_stable_release=luminous \
+      ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
+      ceph_docker_image=ceph/daemon \
+      ceph_docker_image_tag=latest-luminous \
+  "
+
+  bash -c "CEPH_STABLE_RELEASE=luminous 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"
+
+  vagrant destroy --force