Example #1
0
    def setUp(self, _):
        super(GuestAgentMongoDBManagerTest, self).setUp('mongodb')
        self.manager = manager.Manager()

        self.execute_with_timeout_patch = mock.patch.object(
            utils, 'execute_with_timeout', return_value=('0', ''))
        self.addCleanup(self.execute_with_timeout_patch.stop)
        self.execute_with_timeout_patch.start()

        self.pymongo_patch = mock.patch.object(pymongo, 'MongoClient')
        self.addCleanup(self.pymongo_patch.stop)
        self.pymongo_patch.start()

        self.mount_point = '/var/lib/mongodb'
        self.host_wildcard = '%'  # This is used in the test_*_user tests below
        self.serialized_user = {
            '_name': 'testdb.testuser',
            '_password': None,
            '_roles': [{
                'db': 'testdb',
                'role': 'testrole'
            }],
            '_username': '******',
            '_databases': [],
            '_host': self.host_wildcard,
            '_database': {
                '_name': 'testdb',
                '_character_set': None,
                '_collate': None
            },
            '_is_root': False
        }
    def setUp(self, _):
        super(GuestAgentMongoDBClusterManagerTest, self).setUp()
        self.context = context.TroveContext()
        self.manager = manager.Manager()
        self.manager.app.configuration_manager = mock.MagicMock()
        self.manager.app.status = mock.MagicMock()
        self.conf_mgr = self.manager.app.configuration_manager

        self.pymongo_patch = mock.patch.object(pymongo, 'MongoClient')
        self.addCleanup(self.pymongo_patch.stop)
        self.pymongo_patch.start()
    def setUp(self, _):
        super(GuestAgentMongoDBManagerTest, self).setUp('mongodb')
        self.manager = manager.Manager()

        self.execute_with_timeout_patch = mock.patch.object(
            utils, 'execute_with_timeout', return_value=('0', ''))
        self.addCleanup(self.execute_with_timeout_patch.stop)
        self.execute_with_timeout_patch.start()

        self.pymongo_patch = mock.patch.object(pymongo, 'MongoClient')
        self.addCleanup(self.pymongo_patch.stop)
        self.pymongo_patch.start()
Example #4
0
 def setUp(self):
     super(GuestAgentMongoDBManagerTest, self).setUp()
     self.context = TroveContext()
     self.manager = mongo_manager.Manager()
     self.origin_MongoDbAppStatus = mongo_service.MongoDbAppStatus
     self.origin_os_path_exists = os.path.exists
     self.origin_format = volume.VolumeDevice.format
     self.origin_migrate_data = volume.VolumeDevice.migrate_data
     self.origin_mount = volume.VolumeDevice.mount
     self.origin_mount_points = volume.VolumeDevice.mount_points
     self.origin_stop_db = mongo_service.MongoDBApp.stop_db
     self.origin_start_db = mongo_service.MongoDBApp.start_db
     self.orig_exec_with_to = utils.execute_with_timeout
Example #5
0
    def setUp(self, _):
        super(GuestAgentMongoDBManagerTest, self).setUp()
        self.context = trove_testtools.TroveTestContext(self)
        self.manager = manager.Manager()

        self.execute_with_timeout_patch = mock.patch.object(
            utils, 'execute_with_timeout', return_value=('0', ''))
        self.addCleanup(self.execute_with_timeout_patch.stop)
        self.execute_with_timeout_patch.start()

        self.pymongo_patch = mock.patch.object(pymongo, 'MongoClient')
        self.addCleanup(self.pymongo_patch.stop)
        self.pymongo_patch.start()

        self.mount_point = '/var/lib/mongodb'
Example #6
0
    def setUp(self, _):
        super(GuestAgentMongoDBClusterManagerTest, self).setUp()
        self.context = trove_testtools.TroveTestContext(self)
        self.manager = manager.Manager()
        self.manager.app.mongod_configuration_manager = mock.MagicMock()
        self.manager.app.mongos_configuration_manager = mock.MagicMock()
        self.manager.app.configuration_manager = (
            self.manager.app.mongod_configuration_manager)
        self.manager.app.status.set_status = mock.MagicMock()
        self.manager.app.status.set_host = mock.MagicMock()
        self.conf_mgr = self.manager.app.configuration_manager

        self.pymongo_patch = mock.patch.object(
            pymongo, 'MongoClient'
        )
        self.addCleanup(self.pymongo_patch.stop)
        self.pymongo_patch.start()