def setUp(self):
        """ This function will create foreign data wrapper, foreign server
        and foreign table. """
        super(ForeignTableGetTestCase, self).setUp()

        # Load test data
        self.data = self.test_data

        # Get parent schema info
        self.schema_data = parent_node_dict['schema'][-1]
        self.server_id = self.schema_data['server_id']
        self.db_id = self.schema_data['db_id']
        self.db_name = parent_node_dict["database"][-1]["db_name"]

        # Create schema
        self.schema_name = self.schema_data['schema_name']
        self.schema_id = self.schema_data['schema_id']

        # Create FDW, server & table
        self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
        self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
        self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8])

        self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                           self.fdw_name)
        self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                              self.fsrv_name, self.fdw_name)
    def setUp(self):
        """ This function will create foreign data wrapper, foreign server
        and foreign table. """
        super(ForeignTableDeleteMultipleTestCase, self).setUp()

        self.schema_data = parent_node_dict['schema'][-1]
        self.server_id = self.schema_data['server_id']
        self.db_id = self.schema_data['db_id']
        self.db_name = parent_node_dict["database"][-1]["db_name"]
        self.schema_name = self.schema_data['schema_name']
        self.schema_id = self.schema_data['schema_id']
        self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
        self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
        self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8])
        self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                           self.fdw_name)
        self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                              self.fsrv_name, self.fdw_name)
        self.ft_ids = [ft_utils.create_foreign_table(
            self.server, self.db_name,
            self.schema_name, self.fsrv_name,
            "ft_%s" % (str(uuid.uuid4())[1:8])),
            ft_utils.create_foreign_table(
                self.server, self.db_name,
                self.schema_name, self.fsrv_name,
                "ft_%s" % (str(uuid.uuid4())[1:8]))
        ]
示例#3
0
    def setUp(self):
        """ This function will create foreign data wrapper, foreign server
        and foreign table. """
        super(ForeignTableGetTestCase, self).setUp()

        # Load test data
        self.data = self.test_data

        # Get parent schema info
        self.schema_data = parent_node_dict['schema'][-1]
        self.server_id = self.schema_data['server_id']
        self.db_id = self.schema_data['db_id']
        self.db_name = parent_node_dict["database"][-1]["db_name"]

        # Create schema
        self.schema_name = self.schema_data['schema_name']
        self.schema_id = self.schema_data['schema_id']

        # Create FDW, server & table
        self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
        self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
        self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8])

        self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                           self.fdw_name)
        self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                              self.fsrv_name, self.fdw_name)

        if bool(self.inventory_data):
            query = self.inventory_data['query']
            self.ft_id = ft_utils.create_foreign_table(self.server,
                                                       self.db_name,
                                                       self.schema_name,
                                                       self.fsrv_name,
                                                       self.ft_name, query)
        else:
            self.ft_id = ft_utils.create_foreign_table(self.server,
                                                       self.db_name,
                                                       self.schema_name,
                                                       self.fsrv_name,
                                                       self.ft_name)

        # In case of multiple foreign tables
        if self.is_list:
            self.ft_name_2 = "ft_%s" % (str(uuid.uuid4())[1:8])
            self.ft_id_2 = ft_utils.create_foreign_table(self.server,
                                                         self.db_name,
                                                         self.schema_name,
                                                         self.fsrv_name,
                                                         self.ft_name_2)

            self.data['ids'] = [self.ft_id, self.ft_id_2]
示例#4
0
 def setUp(self):
     """ This function will create extension and foreign data wrapper."""
     self.schema_data = parent_node_dict['schema'][-1]
     self.server_id = self.schema_data['server_id']
     self.db_id = self.schema_data['db_id']
     self.db_name = parent_node_dict["database"][-1]["db_name"]
     self.schema_name = self.schema_data['schema_name']
     self.extension_name = "cube"
     self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
     self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
     self.extension_id = extension_utils.create_extension(
         self.server, self.db_name, self.extension_name, self.schema_name)
     self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                        self.fdw_name)
     self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                           self.fsrv_name, self.fdw_name)
示例#5
0
 def setUp(self):
     """ This function will create extension and foreign data wrapper."""
     super(UserMappingDeleteTestCase, self).setUp()
     self.schema_data = parent_node_dict['schema'][-1]
     self.server_id = self.schema_data['server_id']
     self.db_id = self.schema_data['db_id']
     self.db_name = parent_node_dict["database"][-1]["db_name"]
     self.schema_name = self.schema_data['schema_name']
     self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
     self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
     self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                        self.fdw_name)
     self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                           self.fsrv_name, self.fdw_name)
     self.um_id = um_utils.create_user_mapping(self.server, self.db_name,
                                               self.fsrv_name)
    def setUp(self):
        """ This function will create foreign data wrapper and
        foreign server. """
        super(ForeignTableAddTestCase, self).setUp()

        self.schema_data = parent_node_dict['schema'][-1]
        self.server_id = self.schema_data['server_id']
        self.db_id = self.schema_data['db_id']
        self.db_name = parent_node_dict["database"][-1]["db_name"]
        self.schema_name = self.schema_data['schema_name']
        self.schema_id = self.schema_data['schema_id']
        self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
        self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
        self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                           self.fdw_name)
        self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                              self.fsrv_name, self.fdw_name)
        self.ft_name = "ft_%s" % (str(uuid.uuid4())[1:8])
示例#7
0
 def setUp(self):
     """ This function will create extension and foreign data wrapper."""
     super(UserMappingGetTestCase, self).setUp()
     self.schema_data = parent_node_dict['schema'][-1]
     self.server_id = self.schema_data['server_id']
     self.db_id = self.schema_data['db_id']
     self.db_name = parent_node_dict["database"][-1]["db_name"]
     self.schema_name = self.schema_data['schema_name']
     self.extension_name = "cube"
     self.fdw_name = "fdw_%s" % (str(uuid.uuid4())[1:8])
     self.fsrv_name = "fsrv_%s" % (str(uuid.uuid4())[1:8])
     self.extension_id = extension_utils.create_extension(
         self.server, self.db_name, self.extension_name, self.schema_name)
     self.fdw_id = fdw_utils.create_fdw(self.server, self.db_name,
                                        self.fdw_name)
     self.fsrv_id = fsrv_utils.create_fsrv(self.server, self.db_name,
                                           self.fsrv_name, self.fdw_name)
     self.um_id = um_utils.create_user_mapping(self.server, self.db_name,
                                               self.fsrv_name)