Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entry point for single OSD deployments #1211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions zaza/openstack/charm_tests/ceph/osd/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,39 @@
import zaza.model as zaza_model


def setup_osd_standalone():
"""Perform the necessary steps to setup a single OSD."""
cmds = ['sudo ceph osd crush rule rm replicated_rule',
'sudo ceph osd crush rule create-replicated replicated_rule '
'default osd',
'sudo ceph osd erasure-code-profile rm default',
'sudo ceph osd erasure-code-profile set default '
'plugin=jerasure k=2 m=1 crush-failure-domain=osd']
for cmd in cmds:
zaza_model.run_on_unit('ceph-mon/0', cmd)

loops = []
for file in ('l1', 'l2', 'l3'):
zaza_model.run_on_unit('ceph-osd/0', 'touch %s' % file)
zaza_model.run_on_unit('ceph-osd/0', 'truncate --size 2G ./%s' % file)
out = zaza_model.run_on_unit('ceph-osd/0',
'sudo losetup -fP --show ./%s' % file)
loops.append(out['Stdout'].strip())

for loop in loops:
zaza_model.run_action_on_leader('ceph-osd', 'add-disk',
action_params={'osd-devices': loop})

states = None
try:
zaza_model.get_application('ubuntu')
states = {'ubuntu': {'workload-status-message': ''}}
except KeyError:
pass

zaza_model.wait_for_application_states(states=states)


class SecurityTest(unittest.TestCase):
"""Ceph Security Tests."""

Expand Down
Loading