Skip to content

Commit d9f6ae4

Browse files
committed
Rework test requirements
1 parent 5cda896 commit d9f6ae4

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

src/test-requirements.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
tox
99

1010
# Functional Test Requirements (let Zaza's dependencies solve all dependencies here!)
11-
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
12-
#git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
13-
git+https://github.com/lmlg/zaza-openstack-tests.git@ceph-fs-standalone#egg=zaza.openstack
11+
git+https://github.com/openstack-charmers/zaza.git@stable/ussuri#egg=zaza
12+
git+https://github.com/openstack-charmers/zaza-openstack-tests.git@stable/ussuri#egg=zaza.openstack

src/tests/configure.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import zaza.model as zaza_model
2+
3+
def setup_osd_standalone():
4+
"""Perform the necessary steps to setup a single OSD."""
5+
cmds = ['sudo ceph osd crush rule rm replicated_rule',
6+
'sudo ceph osd crush rule create-replicated replicated_rule '
7+
'default osd',
8+
'sudo ceph osd erasure-code-profile rm default',
9+
'sudo ceph osd erasure-code-profile set default '
10+
'plugin=jerasure k=2 m=1 crush-failure-domain=osd']
11+
for cmd in cmds:
12+
zaza_model.run_on_unit('ceph-mon/0', cmd)
13+
14+
loops = []
15+
for file in ('l1', 'l2', 'l3'):
16+
zaza_model.run_on_unit('ceph-osd/0', 'touch %s' % file)
17+
zaza_model.run_on_unit('ceph-osd/0', 'truncate --size 2G ./%s' % file)
18+
out = zaza_model.run_on_unit('ceph-osd/0',
19+
'sudo losetup -fP --show ./%s' % file)
20+
loops.append(out['Stdout'].strip())
21+
22+
for loop in loops:
23+
zaza_model.run_action_on_leader('ceph-osd', 'add-disk',
24+
action_params={'osd-devices': loop})
25+
26+
states = None
27+
try:
28+
zaza_model.get_application('ubuntu')
29+
states = {'ubuntu': {'workload-status-message': ''}}
30+
except KeyError:
31+
pass
32+
33+
zaza_model.wait_for_application_states(states=states)

src/tests/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
charm_name: ceph-fs
22
configure:
3-
- zaza.openstack.charm_tests.ceph.osd.tests.setup_osd_standalone
3+
- tests.configure.setup_osd_standalone
44
tests:
55
- zaza.openstack.charm_tests.ceph.fs.tests.CephFSTests
66
- zaza.openstack.charm_tests.ceph.fs.tests.CharmOperationTest

0 commit comments

Comments
 (0)