def test_gp_interconnect_fc_ard_142(self): if (self.cluster_platform.lower().find('red hat enterprise linux server') < 0): self.skipTest('Test only applies to RHEL platform.') try: out = self.checkGUC(self.gp_interconnect_min_retries_before_timeout) self.assertTrue(len(out) > 4) out = self.checkGUC(self.gp_interconnect_transmit_timeout) self.assertTrue(len(out) > 4) out = self.checkGUC(self.gp_interconnect_fc_method) self.assertTrue(len(out) > 4) except: self.skipTest("GUC " + self.gp_interconnect_min_retries_before_timeout + " or " + self.gp_interconnect_transmit_timeout + " or " + self.gp_interconnect_fc_method + " not defined") result = runShellCommand('gpssh ' + self.hoststr + ' \"export PATH=$PATH:/sbin; \ sudo insmod ickm.ko ict_type=0x101 seq_array=2 drop_times=80\"') self.assertTrue(result) sql_file = local_path(self.common_sql + str(self._testMethodName) + '.sql'); self.assertTrue(PSQL.run_sql_file(local_path(sql_file))) out_file = sql_file.replace(".sql",".out") test_ret = "Failed to send packet (seq 2) to" in open(out_file).read() and "retries in 40 seconds" in open(out_file).read() ret_log = runShellCommand(self.log_str + self._testMethodName + '.log' ) result = runShellCommand('gpssh ' + self.hoststr + ' \"export PATH=$PATH:/sbin;sudo rmmod ickm.ko \"') self.assertTrue(result) self.assertTrue(ret_log) self.assertTrue(test_ret)
def _run_sql_file(self, sql_file, ans_file = None): """ Given a sql file and an ans file, this adds the specified gucs (self.gucs) to the sql file , runs the sql against the test case databse (self.db_name) and verifies the output with the ans file. """ result = True self.test_artifacts.append(sql_file) out_file = os.path.join(self.get_out_dir(), os.path.basename(sql_file).replace('.sql','.out')) self.test_artifacts.append(out_file) PSQL.run_sql_file(sql_file, dbname = self.db_name, out_file = out_file) if out_file[-2:] == '.t': out_file = out_file[:-2] if ans_file is not None: self.test_artifacts.append(ans_file) result = Gpdiff.are_files_equal(out_file, ans_file) if result == False: self.test_artifacts.append(out_file.replace('.out', '.diff')) return result
def run_sql_under_KM_dropMore(self,suffix): result = runShellCommand('gpssh' + self.hoststr + ' \"sudo dmesg -c\"') self.assertTrue(result) runShellCommand('gpssh ' + self.hoststr + ' \"export PATH=$PATH:/sbin; \ sudo rmmod ickm.ko\"') result = runShellCommand('gpssh' + self.hoststr + ' \"export PATH=$PATH:/sbin;sudo insmod ickm.ko ict_type=0x101 seq_array=2 drop_times=80\"') self.assertTrue(result) sql_file = local_path(self.gucCheck_sql + str(self._testMethodName) + suffix + '.sql') self.assertTrue(PSQL.run_sql_file(sql_file)) result = runShellCommand('gpssh' + self.hoststr + ' \"export PATH=$PATH:/sbin;sudo rmmod ickm.ko \"') self.assertTrue(result) out_file = sql_file.replace(".sql",".out") return out_file
def test_gp_interconnect_fc_ard_142(self): if (self.cluster_platform.lower().find( 'red hat enterprise linux server') < 0): self.skipTest('Test only applies to RHEL platform.') try: out = self.checkGUC( self.gp_interconnect_min_retries_before_timeout) self.assertTrue(len(out) > 4) out = self.checkGUC(self.gp_interconnect_transmit_timeout) self.assertTrue(len(out) > 4) out = self.checkGUC(self.gp_interconnect_fc_method) self.assertTrue(len(out) > 4) except: self.skipTest("GUC " + self.gp_interconnect_min_retries_before_timeout + " or " + self.gp_interconnect_transmit_timeout + " or " + self.gp_interconnect_fc_method + " not defined") result = runShellCommand('gpssh ' + self.hoststr + ' \"export PATH=$PATH:/sbin; \ sudo insmod ickm.ko ict_type=0x101 seq_array=2 drop_times=80\"' ) self.assertTrue(result) sql_file = local_path(self.common_sql + str(self._testMethodName) + '.sql') self.assertTrue(PSQL.run_sql_file(local_path(sql_file))) out_file = sql_file.replace(".sql", ".out") test_ret = "Failed to send packet (seq 2) to" in open(out_file).read( ) and "retries in 40 seconds" in open(out_file).read() ret_log = runShellCommand(self.log_str + self._testMethodName + '.log') result = runShellCommand( 'gpssh ' + self.hoststr + ' \"export PATH=$PATH:/sbin;sudo rmmod ickm.ko \"') self.assertTrue(result) self.assertTrue(ret_log) self.assertTrue(test_ret)