self._orch_cmd("daemon", "start", "mds.a")
def test_osd_create(self):
- self._orch_cmd("osd", "create", "*:device")
- self._orch_cmd("osd", "create", "*:device,device2")
-
- drive_groups = {
- 'test': {
- "host_pattern": "*",
- "data_devices": {"paths": ["/dev/sda"]}
- }
- }
-
- res = self._orch_cmd_result("osd", "create", "-i", "-", stdin=json.dumps(drive_groups))
+ drive_group = """
+service_type: osd
+service_id: any.sda
+placement:
+ host_pattern: '*'
+data_devices:
+ all: True
+"""
+ res = self._orch_cmd_result("apply", "osd", "-i", "-",
+ stdin=drive_group)
self.assertEqual(res, 0)
- with self.assertRaises(Exception):
- self._orch_cmd("osd", "create", "notfound:device")
-
def test_blink_device_light(self):
def _ls_lights(what):
return json.loads(self._cmd("device", "ls-lights"))[what]
)
)
+ def apply_drivegroups(self, specs):
+ # type: (List[DriveGroupSpec]) -> TestCompletion
+ drive_group = specs[0]
+ def run(all_hosts):
+ # type: (List[orchestrator.HostSpec]) -> None
+ drive_group.validate()
+ if drive_group.placement.host_pattern:
+ if not drive_group.placement.pattern_matches_hosts([h.hostname for h in all_hosts]):
+ raise orchestrator.OrchestratorValidationError('failed to match')
+ return self.get_hosts().then(run).then(
+ on_complete=orchestrator.ProgressReference(
+ message='apply_drivesgroups',
+ mgr=self,
+ )
+ )
+
@deferred_write("remove_daemons")
def remove_daemons(self, names, force):
assert isinstance(names, list)