Пример #1
0
 def test_pillar_reset(self):
     PillarManager.set('ceph-salt:test', 'some text')
     val = PillarManager.get('ceph-salt:test')
     self.assertEqual(val, 'some text')
     PillarManager.reset('ceph-salt:test')
     val = PillarManager.get('ceph-salt:test')
     self.assertIsNone(val)
Пример #2
0
 def test_time_server_not_a_minion(self):
     not_minion_err = ('Time server is not a minion: {} '
                       'setting will not have any effect')
     PillarManager.set('ceph-salt:time_server:server_hosts',
                       ['foo.example.com'])
     PillarManager.reset('ceph-salt:time_server:external_time_servers')
     self.assertValidateConfig(not_minion_err.format('time server subnet'))
     PillarManager.reset('ceph-salt:time_server:subnet')
     PillarManager.set('ceph-salt:time_server:external_time_servers',
                       ['pool.ntp.org'])
     self.assertValidateConfig(
         not_minion_err.format('external time servers'))
Пример #3
0
 def test_updates_enabled_not_set(self):
     PillarManager.reset('ceph-salt:updates:enabled')
     self.assertEqual(
         validate_config([]),
         "'ceph-salt:updates:enabled' must be of type Boolean")
Пример #4
0
 def test_dashboard_password_update_required_not_set(self):
     PillarManager.reset('ceph-salt:dashboard:password_update_required')
     self.assertEqual(
         validate_config(False),
         "'ceph-salt:dashboard:password_update_required' must be of type Boolean"
     )
Пример #5
0
 def test_no_dashboard_password(self):
     PillarManager.reset('ceph-salt:dashboard:password')
     self.assertEqual(validate_config(False),
                      "No dashboard password specified in config")
Пример #6
0
 def test_no_bootstrap_mon_ip(self):
     PillarManager.reset('ceph-salt:bootstrap_mon_ip')
     self.assertEqual(validate_config(False),
                      "No bootstrap Mon IP specified in config")
Пример #7
0
 def test_ssh_no_user(self):
     PillarManager.reset('ceph-salt:ssh:user')
     self.assertEqual(validate_config(False),
                      "No SSH user specified in config")
Пример #8
0
 def test_no_bootstrap_minion(self):
     PillarManager.reset('ceph-salt:bootstrap_minion')
     self.assertEqual(validate_config(False),
                      "No bootstrap minion specified in config")
     self.assertEqual(validate_config(True), None)
Пример #9
0
 def test_no_time_server_subnet(self):
     PillarManager.reset('ceph-salt:time_server:subnet')
     self.assertEqual(validate_config(False),
                      "No time server subnet specified in config")
Пример #10
0
 def test_no_bootstrap_mon_ip(self):
     PillarManager.reset('ceph-salt:bootstrap_mon_ip')
     self.assertValidateConfig("No bootstrap Mon IP specified in config")
Пример #11
0
 def test_ssh_no_public_key(self):
     PillarManager.reset('ceph-salt:ssh:public_key')
     self.assertValidateConfig("No SSH public key specified in config")
Пример #12
0
 def test_no_bootstrap_minion(self):
     PillarManager.reset('ceph-salt:bootstrap_minion')
     self.assertValidateConfig("No bootstrap minion specified in config")
     self.assertValidateConfig(None, deployed=True)
Пример #13
0
 def test_no_time_server_host(self):
     PillarManager.reset('ceph-salt:time_server:server_host')
     self.assertEqual(validate_config([]), "No time server host specified in config")
Пример #14
0
 def test_no_bootstrap_minion(self):
     PillarManager.reset('ceph-salt:bootstrap_minion')
     self.assertEqual(validate_config([]), "No bootstrap minion specified in config")
     self.assertEqual(validate_config([{'hostname': 'node1'}]), None)
Пример #15
0
 def test_no_boostrap_minion(self):
     PillarManager.reset('ceph-salt:bootstrap_minion')
     self.assertEqual(validate_config(),
                      "At least one minion must be both 'Mgr' and 'Mon'")
Пример #16
0
 def test_no_dashboard_username(self):
     PillarManager.reset('ceph-salt:dashboard:username')
     self.assertValidateConfig("No dashboard username specified in config")
Пример #17
0
 def test_time_server_enabled_not_set(self):
     PillarManager.reset('ceph-salt:time_server:enabled')
     self.assertEqual(
         validate_config(False),
         "'ceph-salt:time_server:enabled' must be of type Boolean")
Пример #18
0
 def test_no_dashboard_password(self):
     PillarManager.reset('ceph-salt:dashboard:password')
     self.assertValidateConfig("No dashboard password specified in config")
Пример #19
0
 def test_no_external_time_servers(self):
     PillarManager.reset('ceph-salt:time_server:external_time_servers')
     self.assertEqual(validate_config(False),
                      "No external time servers specified in config")
Пример #20
0
 def test_dashboard_ssl_certificate(self):
     PillarManager.reset('ceph-salt:dashboard:ssl_certificate_key')
     self.assertValidateConfig("Dashboard SSL certificate provided, "
                               "but no SSL certificate key specified")
Пример #21
0
 def test_no_ceph_container_image_path(self):
     PillarManager.reset('ceph-salt:container:images:ceph')
     self.assertEqual(validate_config(False),
                      "No Ceph container image path specified in config")
Пример #22
0
 def test_dashboard_password_update_required_not_set(self):
     PillarManager.reset('ceph-salt:dashboard:password_update_required')
     self.assertValidateConfig(
         "'ceph-salt:dashboard:password_update_required' "
         "must be of type Boolean")
Пример #23
0
 def test_ssh_no_public_key(self):
     PillarManager.reset('ceph-salt:ssh:public_key')
     self.assertEqual(validate_config(False),
                      "No SSH public key specified in config")
Пример #24
0
 def test_time_server_enabled_not_set(self):
     PillarManager.reset('ceph-salt:time_server:enabled')
     self.assertValidateConfig(
         "'ceph-salt:time_server:enabled' must be of type Boolean")
Пример #25
0
 def test_no_dashboard_username(self):
     PillarManager.reset('ceph-salt:dashboard:username')
     self.assertEqual(validate_config(False),
                      "No dashboard username specified in config")
Пример #26
0
 def test_no_time_server_subnet(self):
     PillarManager.reset('ceph-salt:time_server:subnet')
     self.assertValidateConfig("No time server subnet specified in config")
Пример #27
0
 def test_dashboard_ssl_certificate_key(self):
     PillarManager.reset('ceph-salt:dashboard:ssl_certificate')
     self.assertEqual(
         validate_config(False), "Dashboard SSL certificate key provided, "
         "but no SSL certificate specified")
Пример #28
0
 def test_no_external_time_servers(self):
     PillarManager.reset('ceph-salt:time_server:external_time_servers')
     self.assertValidateConfig(
         "No external time servers specified in config")
Пример #29
0
 def test_updates_reboot_not_set(self):
     PillarManager.reset('ceph-salt:updates:reboot')
     self.assertEqual(validate_config(False),
                      "'ceph-salt:updates:reboot' must be of type Boolean")
Пример #30
0
 def test_ssh_no_private_key(self):
     PillarManager.reset('ceph-salt:ssh:private_key')
     self.assertEqual(validate_config([]),
                      "No SSH private key specified in config")