mirror of https://github.com/ceph/ceph-ansible.git
tests: update testinfra release
In order to support ansible 2.8 with testinfra we need to use the
latest release (3.0.x).
Adding ssh-config option to py.test.
Also bumping the pytest and xdist version.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit de147469d7
)
pull/4016/head
parent
6e917da52a
commit
63f99fb965
|
@ -29,10 +29,10 @@ class TestMons(object):
|
||||||
output = host.check_output(cmd)
|
output = host.check_output(cmd)
|
||||||
assert output.strip().startswith("cluster")
|
assert output.strip().startswith("cluster")
|
||||||
|
|
||||||
def test_ceph_config_has_inital_members_line(self, node, File, setup):
|
def test_ceph_config_has_inital_members_line(self, node, host, setup):
|
||||||
assert File(setup["conf_path"]).contains("^mon initial members = .*$")
|
assert host.file(setup["conf_path"]).contains("^mon initial members = .*$")
|
||||||
|
|
||||||
def test_initial_members_line_has_correct_value(self, node, host, File, setup): # noqa E501
|
def test_initial_members_line_has_correct_value(self, node, host, setup):
|
||||||
mon_initial_members_line = host.check_output("grep 'mon initial members = ' /etc/ceph/{cluster}.conf".format(cluster=setup['cluster_name'])) # noqa E501
|
mon_initial_members_line = host.check_output("grep 'mon initial members = ' /etc/ceph/{cluster}.conf".format(cluster=setup['cluster_name'])) # noqa E501
|
||||||
result = True
|
result = True
|
||||||
for host in node["vars"]["groups"]["mons"]:
|
for host in node["vars"]["groups"]["mons"]:
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
# These are Python requirements needed to run the functional tests
|
# These are Python requirements needed to run the functional tests
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
testinfra==1.19.0
|
testinfra>=3.0,<3.1
|
||||||
pytest-xdist==1.27.0
|
pytest-xdist==1.28.0
|
||||||
pytest==3.6.1
|
pytest>=4.4,<4.5
|
||||||
notario>=0.0.13
|
notario>=0.0.13
|
||||||
ansible>=2.8,<2.9
|
ansible>=2.8,<2.9
|
||||||
netaddr
|
netaddr
|
||||||
mock
|
mock
|
||||||
|
jmespath
|
||||||
|
paramiko
|
||||||
|
|
|
@ -64,6 +64,6 @@ commands=
|
||||||
ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \
|
ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \
|
||||||
"
|
"
|
||||||
|
|
||||||
bash -c "CEPH_STABLE_RELEASE={env:CEPH_STABLE_RELEASE:nautilus} py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests"
|
bash -c "CEPH_STABLE_RELEASE={env:CEPH_STABLE_RELEASE:nautilus} 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
|
vagrant destroy --force
|
||||||
|
|
|
@ -76,6 +76,6 @@ commands=
|
||||||
ceph_docker_image_tag={env:UPDATE_CEPH_DOCKER_IMAGE_TAG:latest-nautilus} \
|
ceph_docker_image_tag={env:UPDATE_CEPH_DOCKER_IMAGE_TAG:latest-nautilus} \
|
||||||
"
|
"
|
||||||
|
|
||||||
bash -c "CEPH_STABLE_RELEASE={env:UPDATE_CEPH_STABLE_RELEASE:nautilus} py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests"
|
bash -c "CEPH_STABLE_RELEASE={env:UPDATE_CEPH_STABLE_RELEASE:nautilus} 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
|
vagrant destroy --force
|
||||||
|
|
26
tox.ini
26
tox.ini
|
@ -51,7 +51,7 @@ commands=
|
||||||
# wait 30sec for services to be ready
|
# wait 30sec for services to be ready
|
||||||
sleep 30
|
sleep 30
|
||||||
# test cluster state using ceph-ansible tests
|
# test cluster state using ceph-ansible tests
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {envdir}/tmp/ceph-ansible/tests/functional/tests
|
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts --ssh-config={changedir}/vagrant_ssh_config {envdir}/tmp/ceph-ansible/tests/functional/tests
|
||||||
|
|
||||||
# install ceph-ansible@master requirements
|
# install ceph-ansible@master requirements
|
||||||
pip install -r {toxinidir}/tests/requirements.txt
|
pip install -r {toxinidir}/tests/requirements.txt
|
||||||
|
@ -68,13 +68,13 @@ commands=
|
||||||
"
|
"
|
||||||
|
|
||||||
# test cluster state again using ceph-ansible tests
|
# test cluster state again using ceph-ansible tests
|
||||||
bash -c "CEPH_STABLE_RELEASE=nautilus py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests"
|
bash -c "CEPH_STABLE_RELEASE=nautilus py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests"
|
||||||
|
|
||||||
# reboot all vms
|
# reboot all vms
|
||||||
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/reboot.yml
|
ansible-playbook -vv -i {changedir}/hosts {toxinidir}/tests/functional/reboot.yml
|
||||||
|
|
||||||
# retest to ensure cluster came back up correctly after rebooting
|
# retest to ensure cluster came back up correctly after rebooting
|
||||||
bash -c "CEPH_STABLE_RELEASE=nautilus py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests"
|
bash -c "CEPH_STABLE_RELEASE=nautilus py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests"
|
||||||
|
|
||||||
vagrant destroy --force
|
vagrant destroy --force
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ commands=
|
||||||
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
||||||
"
|
"
|
||||||
# test that the cluster can be redeployed in a healthy state
|
# test that the cluster can be redeployed in a healthy state
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/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
|
||||||
|
|
||||||
[purge-lvm]
|
[purge-lvm]
|
||||||
commands=
|
commands=
|
||||||
|
@ -161,7 +161,7 @@ commands=
|
||||||
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
||||||
"
|
"
|
||||||
# test that the cluster can be redeployed in a healthy state
|
# test that the cluster can be redeployed in a healthy state
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/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
|
||||||
|
|
||||||
[shrink-mon]
|
[shrink-mon]
|
||||||
commands=
|
commands=
|
||||||
|
@ -190,7 +190,7 @@ commands=
|
||||||
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
||||||
"
|
"
|
||||||
|
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers {toxinidir}/tests/functional/tests
|
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[add-mons]
|
[add-mons]
|
||||||
commands=
|
commands=
|
||||||
|
@ -203,7 +203,7 @@ commands=
|
||||||
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
|
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
|
||||||
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-nautilus} \
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-nautilus} \
|
||||||
"
|
"
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
|
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[add-osds]
|
[add-osds]
|
||||||
commands=
|
commands=
|
||||||
|
@ -217,7 +217,7 @@ commands=
|
||||||
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
|
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
|
||||||
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
|
||||||
"
|
"
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
|
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[add-mgrs]
|
[add-mgrs]
|
||||||
commands=
|
commands=
|
||||||
|
@ -247,7 +247,7 @@ commands=
|
||||||
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
||||||
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
||||||
"
|
"
|
||||||
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
|
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[add-rbdmirrors]
|
[add-rbdmirrors]
|
||||||
commands=
|
commands=
|
||||||
|
@ -262,7 +262,7 @@ commands=
|
||||||
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
||||||
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
||||||
"
|
"
|
||||||
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
|
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[add-rgws]
|
[add-rgws]
|
||||||
commands=
|
commands=
|
||||||
|
@ -277,7 +277,7 @@ commands=
|
||||||
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
|
||||||
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
|
||||||
"
|
"
|
||||||
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 {toxinidir}/tests/functional/tests
|
py.test -n 8 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-2 --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests
|
||||||
|
|
||||||
[rgw-multisite]
|
[rgw-multisite]
|
||||||
commands=
|
commands=
|
||||||
|
@ -413,14 +413,14 @@ commands=
|
||||||
# wait 30sec for services to be ready
|
# wait 30sec for services to be ready
|
||||||
sleep 30
|
sleep 30
|
||||||
# test cluster state using ceph-ansible tests
|
# test cluster state using ceph-ansible tests
|
||||||
py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/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
|
||||||
|
|
||||||
# reboot all vms
|
# reboot all vms
|
||||||
all_daemons: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml
|
all_daemons: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/reboot.yml
|
||||||
|
|
||||||
# wait 30sec for services to be ready
|
# wait 30sec for services to be ready
|
||||||
# retest to ensure cluster came back up correctly after rebooting
|
# retest to ensure cluster came back up correctly after rebooting
|
||||||
all_daemons: py.test -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} {toxinidir}/tests/functional/tests
|
all_daemons: 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
|
||||||
|
|
||||||
# handlers/idempotency test
|
# handlers/idempotency test
|
||||||
all_daemons: 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_stable_release={env:CEPH_STABLE_RELEASE:nautilus} 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_BIS:latest-bis-master} copy_admin_key={env:COPY_ADMIN_KEY:False} " --extra-vars @ceph-override.json
|
all_daemons: 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_stable_release={env:CEPH_STABLE_RELEASE:nautilus} 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_BIS:latest-bis-master} copy_admin_key={env:COPY_ADMIN_KEY:False} " --extra-vars @ceph-override.json
|
||||||
|
|
Loading…
Reference in New Issue