Example #1
0
    def test_rgw_update_fail(self, _send_command, _get_connection, _save_host,
                             _rm_host, cephadm_module):

        with self._with_host(cephadm_module, 'host1'):
            with self._with_host(cephadm_module, 'host2'):
                ps = PlacementSpec(hosts=['host1'], count=1)
                c = cephadm_module.add_rgw(
                    RGWSpec('realm', 'zone1', placement=ps))
                [out] = wait(cephadm_module, c)
                match_glob(out,
                           "Deployed rgw.realm.zone1.host1.* on host 'host1'")

                ps = PlacementSpec(hosts=['host2'], count=1)
                c = cephadm_module.add_rgw(
                    RGWSpec('realm', 'zone2', placement=ps))
                [out] = wait(cephadm_module, c)
                match_glob(out,
                           "Deployed rgw.realm.zone2.host2.* on host 'host2'")

                c = cephadm_module.list_daemons()
                r = wait(cephadm_module, c)
                assert len(r) == 2

                with pytest.raises(OrchestratorError):
                    ps = PlacementSpec(hosts=['host1', 'host2'], count=2)
                    c = cephadm_module.add_rgw(
                        RGWSpec('realm', 'zone1', placement=ps))
                    [out] = wait(cephadm_module, c)
Example #2
0
    def test_rgw_update(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):

        with self._with_host(cephadm_module, 'host1'):
            with self._with_host(cephadm_module, 'host2'):
                ps = PlacementSpec(hosts=['host1'], count=1)
                c = cephadm_module.add_rgw(RGWSpec('realm', 'zone1', placement=ps))
                [out] = wait(cephadm_module, c)
                match_glob(out, "Deployed rgw.realm.zone1.host1.* on host 'host1'")

                ps = PlacementSpec(hosts=['host1', 'host2'], count=2)
                c = cephadm_module._apply_service(RGWSpec('realm', 'zone1', placement=ps))
                [out] = wait(cephadm_module, c)
                match_glob(out, "Deployed rgw.realm.zone1.host2.* on host 'host2'")
Example #3
0
    def test_rgw_update(self, cephadm_module):
        with self._with_host(cephadm_module, 'host1'):
            with self._with_host(cephadm_module, 'host2'):
                ps = PlacementSpec(hosts=['host1'], count=1)
                c = cephadm_module.add_rgw(
                    RGWSpec('realm', 'zone1', placement=ps))
                [out] = wait(cephadm_module, c)
                match_glob(out,
                           "Deployed rgw.realm.zone1.host1.* on host 'host1'")

                ps = PlacementSpec(hosts=['host1', 'host2'], count=2)
                r = cephadm_module._apply_service(
                    RGWSpec('realm', 'zone1', placement=ps))
                assert r
Example #4
0
 def test_rgw(self, _send_command, _get_connection, cephadm_module):
     with self._with_host(cephadm_module, 'test'):
         ps = PlacementSpec(nodes=['test'])
         c = cephadm_module.add_rgw(RGWSpec('realm', 'zone', ps))
         [out] = self._wait(cephadm_module, c)
         assert "(Re)deployed rgw.realm.zone." in out
         assert " on host 'test'" in out
Example #5
0
    def test_rgw(self, _send_command, _get_connection, _save_host, _rm_host, cephadm_module):

        with self._with_host(cephadm_module, 'test'):
            ps = PlacementSpec(hosts=['test'], count=1)
            c = cephadm_module.add_rgw(RGWSpec('realm', 'zone', placement=ps))
            [out] = wait(cephadm_module, c)
            match_glob(out, "Deployed rgw.realm.zone.* on host 'test'")
Example #6
0
 def test_rgw(self, _send_command, _get_connection, ssh_module):
     with self._with_host(ssh_module, 'test'):
         ps = PlacementSpec(nodes=['test'])
         c = ssh_module.add_rgw(RGWSpec('name', ps))
         [out] = self._wait(ssh_module, c)
         assert "(Re)deployed rgw.name." in out
         assert " on host 'test'" in out
Example #7
0
def test_rgwspec():
    """
    {
        "rgw_zone": "zonename",
        "service_type": "rgw",
        "rgw_frontend_port": 8080,
        "rgw_realm": "realm"
    }
    """
    example = json.loads(test_rgwspec.__doc__.strip())
    spec = RGWSpec.from_json(example)
    assert servicespec_validate_add(spec) is None
Example #8
0
def test_rgwspec():
    """
    {
        "rgw_zone": "zonename",
        "rgw_frontend_port": 8080,
        "rgw_zonegroup": "group",
        "rgw_zone_user": "******",
        "rgw_realm": "realm",
        "count": 3
    }
    """
    example = json.loads(test_rgwspec.__doc__.strip())
    spec = RGWSpec.from_json(example)
    assert spec.validate_add() is None