Exemplo n.º 1
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         hostname='node111',
         ip='10.109.0.2',
     )
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'dir',
                     'path': '/var/log/remote',
                 }],
             },
             'slave': {
                 'hosts': [{
                     'hostname': 'node111',
                     'address': '10.109.0.2',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
         'target': '/path/to/save',
         'lastdump': '/path/to/latest',
         'timestamp': True,
         'compression_level': 3,
         'timeout': 60,
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 2
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         hostname='node111',
         ip='10.109.0.2',
     )
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'dir',
                     'path': '/var/log/remote',
                 }],
             },
             'slave': {
                 'hosts': [{
                     'hostname': 'node111',
                     'address': '10.109.0.2',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
         'target': '/path/to/save',
         'lastdump': '/path/to/latest',
         'timestamp': True,
         'compression_level': 3,
         'timeout': 60,
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 3
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         name='node1',
         fqdn='node1.domain.tld'
     )
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {}
                 }],
             },
             'slave': {
                 'hosts': [{
                     'address': 'node1.domain.tld',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 4
0
 def test_snapshot_conf(self):
     self.env.create_node(status='ready',
                          name='node1',
                          fqdn='node1.domain.tld')
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {}
                 }],
             },
             'slave': {
                 'hosts': [{
                     'address': 'node1.domain.tld',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 5
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         name='node1',
         fqdn='node1.domain.tld'
     )
     self.env.create_rh_account(
         username='******',
         password='******'
     )
     conf = {
         'dump_roles': {
             'master': [],
             'slave': ['node1.domain.tld']
         },
         'dump_objects': {
             'master': [
                 {
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {
                         'RHUSER': '******',
                         'RHPASS': '******'
                     }
                 }
             ],
             'slave': []
         }
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 6
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         name='node1',
         fqdn='node1.domain.tld'
     )
     self.env.create_rh_account(
         username='******',
         password='******'
     )
     conf = {
         'dump_roles': {
             'master': [],
             'slave': ['node1.domain.tld']
         },
         'dump_objects': {
             'master': [
                 {
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {
                         'RHUSER': '******',
                         'RHPASS': '******'
                     }
                 }
             ],
             'slave': []
         }
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 7
0
 def test_snapshot_conf(self):
     self.env.create_node(status='ready',
                          name='node1',
                          fqdn='node1.domain.tld')
     self.env.create_rh_account(username='******', password='******')
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {
                         'RHUSER': '******',
                         'RHPASS': '******'
                     }
                 }],
             },
             'slave': {
                 'hosts': [{
                     'address': 'node1.domain.tld',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
     }
     self.datadiff(DumpTask.conf(), conf)
 def test_snapshot_conf(self):
     self.env.create_node(status="ready", name="node1", fqdn="node1.domain.tld")
     conf = {
         "dump": {
             "local": {"hosts": [], "objects": []},
             "master": {"hosts": [], "objects": [{"type": "subs", "path": "/var/log/remote", "subs": {}}]},
             "slave": {"hosts": [{"address": "node1.domain.tld", "ssh-key": "/root/.ssh/id_rsa"}], "objects": []},
         }
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 9
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name="dump")
     DumpTask.execute(task)
     message = {
         "api_version": "1",
         "method": "dump_environment",
         "respond_to": "dump_environment_resp",
         "args": {"task_uuid": task.uuid, "settings": DumpTask.conf()},
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEqual(len(args), 2)
     self.datadiff(args[1], message)
Exemplo n.º 10
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name='dump')
     DumpTask.execute(task)
     message = {
         'api_version': '1',
         'method': 'dump_environment',
         'respond_to': 'dump_environment_resp',
         'args': {
             'task_uuid': task.uuid,
             'settings': DumpTask.conf()
         }
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEquals(len(args), 2)
     self.datadiff(args[1], message)
Exemplo n.º 11
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name='dump')
     DumpTask.execute(task)
     message = {
         'api_version': '1',
         'method': 'dump_environment',
         'respond_to': 'dump_environment_resp',
         'args': {
             'task_uuid': task.uuid,
             'settings': DumpTask.conf()
         }
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEqual(len(args), 2)
     self.datadiff(args[1], message)
Exemplo n.º 12
0
 def test_snapshot_conf(self):
     self.env.create_node(status="ready", hostname="node111")
     conf = {
         "dump": {
             "local": {"hosts": [], "objects": []},
             "master": {"hosts": [], "objects": [{"type": "subs", "path": "/var/log/remote", "subs": {}}]},
             "slave": {"hosts": [{"address": "node111.example.com", "ssh-key": "/root/.ssh/id_rsa"}], "objects": []},
         },
         "target": "/path/to/save",
         "lastdump": "/path/to/latest",
         "timestamp": True,
         "compression_level": 3,
         "timeout": 60,
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 13
0
 def test_snapshot_conf(self):
     self.env.create_node(status="ready", name="node1", fqdn="node1.domain.tld")
     self.env.create_rh_account(username="******", password="******")
     conf = {
         "dump_roles": {"master": [], "slave": ["node1.domain.tld"]},
         "dump_objects": {
             "master": [
                 {
                     "type": "subs",
                     "path": "/var/log/remote",
                     "subs": {"RHUSER": "******", "RHPASS": "******"},
                 }
             ],
             "slave": [],
         },
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 14
0
 def test_snapshot_conf(self):
     self.env.create_node(
         status='ready',
         name='node1',
         fqdn='node1.domain.tld'
     )
     self.env.create_rh_account(
         username='******',
         password='******'
     )
     conf = {
         'dump': {
             'local': {
                 'hosts': [],
                 'objects': [],
             },
             'master': {
                 'hosts': [],
                 'objects': [{
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {
                         'RHUSER': '******',
                         'RHPASS': '******'
                     }
                 }],
             },
             'slave': {
                 'hosts': [{
                     'address': 'node1.domain.tld',
                     'ssh-key': '/root/.ssh/id_rsa',
                 }],
                 'objects': [],
             },
         },
     }
     self.datadiff(DumpTask.conf(), conf)
Exemplo n.º 15
0
    def GET(self):
        """Generates default config for snapshot

        :http: * 200
        """
        return DumpTask.conf()
Exemplo n.º 16
0
 def GET(self):
     """Generates default config for snapshot
     :http: * 200
     """
     return DumpTask.conf()