コード例 #1
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name="dump")
     DumpTask.execute(task)
     message = {
         "method": "dump_environment",
         "respond_to": "dump_environment_resp",
         "args": {"task_uuid": task.uuid, "lastdump": "LASTDUMP"},
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEquals(len(args), 2)
     self.datadiff(args[1], message)
コード例 #2
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name='dump')
     DumpTask.execute(task)
     message = {
         'method': 'dump_environment',
         'respond_to': 'dump_environment_resp',
         'args': {
             'task_uuid': task.uuid,
             'lastdump': 'LASTDUMP'
         }
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEquals(len(args), 2)
     self.datadiff(args[1], message)
コード例 #3
0
 def test_snapshot_cast(self, mocked_rpc):
     task = self.env.create_task(name='dump')
     DumpTask.execute(task)
     message = {
         'method': 'dump_environment',
         'respond_to': 'dump_environment_resp',
         'args': {
             'task_uuid': task.uuid,
             'lastdump': 'LASTDUMP'
         }
     }
     args, kwargs = nailgun.task.task.rpc.cast.call_args
     self.assertEquals(len(args), 2)
     self.datadiff(args[1], message)
コード例 #4
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)
コード例 #5
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)
コード例 #6
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)
コード例 #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_roles': {
             'master': [],
             'slave': ['node1.domain.tld']
         },
         'dump_objects': {
             'master': [
                 {
                     'type': 'subs',
                     'path': '/var/log/remote',
                     'subs': {
                         'RHUSER': '******',
                         'RHPASS': '******'
                     }
                 }
             ],
             'slave': []
         }
     }
     self.datadiff(DumpTask.conf(), conf)
コード例 #8
0
ファイル: test_logs_handlers.py プロジェクト: tsipa/fuel-web
 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)
コード例 #9
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)
コード例 #10
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)
コード例 #11
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)
コード例 #12
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)
コード例 #13
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)
コード例 #14
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)
コード例 #15
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)
コード例 #16
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)
コード例 #17
0
    def GET(self):
        """Generates default config for snapshot

        :http: * 200
        """
        return DumpTask.conf()
コード例 #18
0
ファイル: logs.py プロジェクト: nebril/fuel-web
 def GET(self):
     """Generates default config for snapshot
     :http: * 200
     """
     return DumpTask.conf()