提交 b3bb1a15 编写于 作者: sangshuduo's avatar sangshuduo

Merge branch 'develop' into hotfix/sangshuduo/TD-7790-taosdump-stb-dump

...@@ -124,6 +124,10 @@ IF (TD_APLHINE) ...@@ -124,6 +124,10 @@ IF (TD_APLHINE)
MESSAGE(STATUS "aplhine is defined") MESSAGE(STATUS "aplhine is defined")
ENDIF () ENDIF ()
IF (TD_BUILD_HTTP)
ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF ()
IF (TD_LINUX) IF (TD_LINUX)
ADD_DEFINITIONS(-DLINUX) ADD_DEFINITIONS(-DLINUX)
ADD_DEFINITIONS(-D_LINUX) ADD_DEFINITIONS(-D_LINUX)
......
...@@ -90,6 +90,12 @@ IF (${BUILD_JDBC} MATCHES "false") ...@@ -90,6 +90,12 @@ IF (${BUILD_JDBC} MATCHES "false")
SET(TD_BUILD_JDBC FALSE) SET(TD_BUILD_JDBC FALSE)
ENDIF () ENDIF ()
SET(TD_BUILD_HTTP TRUE)
IF (${BUILD_HTTP} MATCHES "false")
SET(TD_BUILD_HTTP FALSE)
ENDIF ()
SET(TD_MEMORY_SANITIZER FALSE) SET(TD_MEMORY_SANITIZER FALSE)
IF (${MEMORY_SANITIZER} MATCHES "true") IF (${MEMORY_SANITIZER} MATCHES "true")
SET(TD_MEMORY_SANITIZER TRUE) SET(TD_MEMORY_SANITIZER TRUE)
......
...@@ -245,8 +245,10 @@ function install_lib() { ...@@ -245,8 +245,10 @@ function install_lib() {
else else
${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${install_main_dir}/driver/libtaos.1.dylib || :
${csudo} ln -sf ${install_main_dir}/driver/libtaos.1.dylib ${install_main_dir}/driver/libtaos.dylib || :
${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib || : ${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib || :
${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib || : ${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib || :
fi fi
install_jemalloc install_jemalloc
......
...@@ -5,7 +5,11 @@ INCLUDE_DIRECTORIES(inc) ...@@ -5,7 +5,11 @@ INCLUDE_DIRECTORIES(inc)
INCLUDE_DIRECTORIES(jni) INCLUDE_DIRECTORIES(jni)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/plugins/http/inc)
IF (TD_BUILD_HTTP)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/plugins/http/inc)
ENDIF ()
AUX_SOURCE_DIRECTORY(src SRC) AUX_SOURCE_DIRECTORY(src SRC)
IF (TD_LINUX) IF (TD_LINUX)
......
...@@ -29,7 +29,10 @@ ...@@ -29,7 +29,10 @@
#include "tsclient.h" #include "tsclient.h"
#include "ttimer.h" #include "ttimer.h"
#include "ttokendef.h" #include "ttokendef.h"
#ifdef HTTP_EMBEDDED
#include "httpInt.h" #include "httpInt.h"
#endif
static void freeQueryInfoImpl(SQueryInfo* pQueryInfo); static void freeQueryInfoImpl(SQueryInfo* pQueryInfo);
...@@ -5118,11 +5121,14 @@ void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) { ...@@ -5118,11 +5121,14 @@ void tscRemoveCachedTableMeta(STableMetaInfo* pTableMetaInfo, uint64_t id) {
char* cloneCurrentDBName(SSqlObj* pSql) { char* cloneCurrentDBName(SSqlObj* pSql) {
char *p = NULL; char *p = NULL;
#ifdef HTTP_EMBEDDED
HttpContext *pCtx = NULL; HttpContext *pCtx = NULL;
#endif
pthread_mutex_lock(&pSql->pTscObj->mutex); pthread_mutex_lock(&pSql->pTscObj->mutex);
STscObj *pTscObj = pSql->pTscObj; STscObj *pTscObj = pSql->pTscObj;
switch (pTscObj->from) { switch (pTscObj->from) {
#ifdef HTTP_EMBEDDED
case TAOS_REQ_FROM_HTTP: case TAOS_REQ_FROM_HTTP:
pCtx = pSql->param; pCtx = pSql->param;
if (pCtx && pCtx->db[0] != '\0') { if (pCtx && pCtx->db[0] != '\0') {
...@@ -5133,6 +5139,7 @@ char* cloneCurrentDBName(SSqlObj* pSql) { ...@@ -5133,6 +5139,7 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
p = strdup(db); p = strdup(db);
} }
break; break;
#endif
default: default:
break; break;
} }
......
Subproject commit 4a4d79099b076b8ff12d5b4fdbcba54049a6866d Subproject commit 016d8e82a24d72779be0ab0090580a372b4fffca
...@@ -18,7 +18,12 @@ ELSE () ...@@ -18,7 +18,12 @@ ELSE ()
ENDIF () ENDIF ()
ADD_EXECUTABLE(taosd ${SRC}) ADD_EXECUTABLE(taosd ${SRC})
IF (TD_BUILD_HTTP)
TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC}) TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC})
ELSE ()
TARGET_LINK_LIBRARIES(taosd mnode monitor tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC})
ENDIF ()
IF (TD_SOMODE_STATIC) IF (TD_SOMODE_STATIC)
TARGET_LINK_LIBRARIES(taosd taos_static) TARGET_LINK_LIBRARIES(taosd taos_static)
......
...@@ -49,6 +49,7 @@ static void dnodeAllocModules() { ...@@ -49,6 +49,7 @@ static void dnodeAllocModules() {
tsModule[TSDB_MOD_MNODE].startFp = mnodeStartSystem; tsModule[TSDB_MOD_MNODE].startFp = mnodeStartSystem;
tsModule[TSDB_MOD_MNODE].stopFp = mnodeStopSystem; tsModule[TSDB_MOD_MNODE].stopFp = mnodeStopSystem;
#ifdef HTTP_EMBEDDED
tsModule[TSDB_MOD_HTTP].enable = (tsEnableHttpModule == 1); tsModule[TSDB_MOD_HTTP].enable = (tsEnableHttpModule == 1);
tsModule[TSDB_MOD_HTTP].name = "http"; tsModule[TSDB_MOD_HTTP].name = "http";
tsModule[TSDB_MOD_HTTP].initFp = httpInitSystem; tsModule[TSDB_MOD_HTTP].initFp = httpInitSystem;
...@@ -58,6 +59,7 @@ static void dnodeAllocModules() { ...@@ -58,6 +59,7 @@ static void dnodeAllocModules() {
if (tsEnableHttpModule) { if (tsEnableHttpModule) {
dnodeSetModuleStatus(TSDB_MOD_HTTP); dnodeSetModuleStatus(TSDB_MOD_HTTP);
} }
#endif
#ifdef _MQTT #ifdef _MQTT
tsModule[TSDB_MOD_MQTT].enable = (tsEnableMqttModule == 1); tsModule[TSDB_MOD_MQTT].enable = (tsEnableMqttModule == 1);
......
...@@ -240,7 +240,9 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t tid) { ...@@ -240,7 +240,9 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t tid) {
SStatisInfo dnodeGetStatisInfo() { SStatisInfo dnodeGetStatisInfo() {
SStatisInfo info = {0}; SStatisInfo info = {0};
if (dnodeGetRunStatus() == TSDB_RUN_STATUS_RUNING) { if (dnodeGetRunStatus() == TSDB_RUN_STATUS_RUNING) {
#ifdef HTTP_EMBEDDED
info.httpReqNum = httpGetReqCount(); info.httpReqNum = httpGetReqCount();
#endif
info.queryReqNum = atomic_exchange_32(&tsQueryReqNum, 0); info.queryReqNum = atomic_exchange_32(&tsQueryReqNum, 0);
info.submitReqNum = atomic_exchange_32(&tsSubmitReqNum, 0); info.submitReqNum = atomic_exchange_32(&tsSubmitReqNum, 0);
} }
......
...@@ -422,16 +422,16 @@ static void printVersion() { ...@@ -422,16 +422,16 @@ static void printVersion() {
} }
} }
UNUSED_FUNC void errorWrongValue(char *program, char *wrong_arg, char *wrong_value) void errorWrongValue(char *program, char *wrong_arg, char *wrong_value)
{ {
fprintf(stderr, "%s %s: %s is an invalid value\n", program, wrong_arg, wrong_value); fprintf(stderr, "%s %s: %s is an invalid value\n", program, wrong_arg, wrong_value);
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n"); fprintf(stderr, "Try `taosdump --help' or `taosdump --usage' for more information.\n");
} }
static void errorUnrecognized(char *program, char *wrong_arg) static void errorUnrecognized(char *program, char *wrong_arg)
{ {
fprintf(stderr, "%s: unrecognized options '%s'\n", program, wrong_arg); fprintf(stderr, "%s: unrecognized options '%s'\n", program, wrong_arg);
fprintf(stderr, "Try `taosdemo --help' or `taosdemo --usage' for more information.\n"); fprintf(stderr, "Try `taosdump --help' or `taosdump --usage' for more information.\n");
} }
static void errorPrintReqArg(char *program, char *wrong_arg) static void errorPrintReqArg(char *program, char *wrong_arg)
...@@ -440,7 +440,7 @@ static void errorPrintReqArg(char *program, char *wrong_arg) ...@@ -440,7 +440,7 @@ static void errorPrintReqArg(char *program, char *wrong_arg)
"%s: option requires an argument -- '%s'\n", "%s: option requires an argument -- '%s'\n",
program, wrong_arg); program, wrong_arg);
fprintf(stderr, fprintf(stderr,
"Try `taosdemo --help' or `taosdemo --usage' for more information.\n"); "Try `taosdump --help' or `taosdump --usage' for more information.\n");
} }
static void errorPrintReqArg2(char *program, char *wrong_arg) static void errorPrintReqArg2(char *program, char *wrong_arg)
...@@ -449,7 +449,7 @@ static void errorPrintReqArg2(char *program, char *wrong_arg) ...@@ -449,7 +449,7 @@ static void errorPrintReqArg2(char *program, char *wrong_arg)
"%s: option requires a number argument '-%s'\n", "%s: option requires a number argument '-%s'\n",
program, wrong_arg); program, wrong_arg);
fprintf(stderr, fprintf(stderr,
"Try `taosdemo --help' or `taosdemo --usage' for more information.\n"); "Try `taosdump --help' or `taosdump --usage' for more information.\n");
} }
static void errorPrintReqArg3(char *program, char *wrong_arg) static void errorPrintReqArg3(char *program, char *wrong_arg)
...@@ -458,7 +458,7 @@ static void errorPrintReqArg3(char *program, char *wrong_arg) ...@@ -458,7 +458,7 @@ static void errorPrintReqArg3(char *program, char *wrong_arg)
"%s: option '%s' requires an argument\n", "%s: option '%s' requires an argument\n",
program, wrong_arg); program, wrong_arg);
fprintf(stderr, fprintf(stderr,
"Try `taosdemo --help' or `taosdemo --usage' for more information.\n"); "Try `taosdump --help' or `taosdump --usage' for more information.\n");
} }
/* Parse a single option. */ /* Parse a single option. */
...@@ -485,7 +485,14 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -485,7 +485,14 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
errorPrintReqArg2("taosdump", "P"); errorPrintReqArg2("taosdump", "P");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
g_args.port = atoi(arg);
uint64_t port = atoi(arg);
if (port > 65535) {
errorWrongValue("taosdump", "-P or --port", arg);
exit(EXIT_FAILURE);
}
g_args.port = (uint16_t)port;
break; break;
case 'q': case 'q':
g_args.mysqlFlag = atoi(arg); g_args.mysqlFlag = atoi(arg);
......
...@@ -2,7 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) ...@@ -2,7 +2,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
PROJECT(TDengine) PROJECT(TDengine)
ADD_SUBDIRECTORY(monitor) ADD_SUBDIRECTORY(monitor)
ADD_SUBDIRECTORY(http)
IF (TD_BUILD_HTTP)
ADD_SUBDIRECTORY(http)
ENDIF ()
IF (TD_LINUX AND TD_MQTT) IF (TD_LINUX AND TD_MQTT)
ADD_SUBDIRECTORY(mqtt) ADD_SUBDIRECTORY(mqtt)
ENDIF () ENDIF ()
\ No newline at end of file
...@@ -7,8 +7,7 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt ...@@ -7,8 +7,7 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt
CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \ CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \
-Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \ -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \
-Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \ -Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \
-I../../../src/os/inc -I../../../src/inc \ -I../../../deps/cJson/inc
-I../../../src/util/inc -I../../../src/common/inc
all: $(TARGET) all: $(TARGET)
exe: exe:
...@@ -18,12 +17,6 @@ exe: ...@@ -18,12 +17,6 @@ exe:
gcc $(CFLAGS) ./stream.c -o $(ROOT)stream $(LFLAGS) gcc $(CFLAGS) ./stream.c -o $(ROOT)stream $(LFLAGS)
gcc $(CFLAGS) ./subscribe.c -o $(ROOT)subscribe $(LFLAGS) gcc $(CFLAGS) ./subscribe.c -o $(ROOT)subscribe $(LFLAGS)
gcc $(CFLAGS) ./apitest.c -o $(ROOT)apitest $(LFLAGS) gcc $(CFLAGS) ./apitest.c -o $(ROOT)apitest $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest.c -o $(ROOT)clientcfgtest $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest-wrongtype.c -o $(ROOT)clientcfgtest-wrongtype $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest-wrongjson.c -o $(ROOT)clientcfgtest-wrongjson $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest-wrongvalue.c -o $(ROOT)clientcfgtest-wrongvalue $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest-taosd.c -o $(ROOT)clientcfgtest-taosd $(LFLAGS)
clean: clean:
rm $(ROOT)asyncdemo rm $(ROOT)asyncdemo
...@@ -33,9 +26,7 @@ clean: ...@@ -33,9 +26,7 @@ clean:
rm $(ROOT)stream rm $(ROOT)stream
rm $(ROOT)subscribe rm $(ROOT)subscribe
rm $(ROOT)apitest rm $(ROOT)apitest
rm $(ROOT)clientcfgtest
rm $(ROOT)clientcfgtest-wrongtype
rm $(ROOT)clientcfgtest-wrongjson
rm $(ROOT)clientcfgtest-wrongvalue
rm $(ROOT)clientcfgtest-taosd
...@@ -9,7 +9,7 @@ if "%severIp%"=="" (set severIp=127.0.0.1) ...@@ -9,7 +9,7 @@ if "%severIp%"=="" (set severIp=127.0.0.1)
if "%serverPort%"=="" (set serverPort=6030) if "%serverPort%"=="" (set serverPort=6030)
go env -w GO111MODULE=on go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct go env -w GOPROXY=https://goproxy.cn,direct
cd case001 cd case001
case001.bat %severIp% %serverPort% case001.bat %severIp% %serverPort%
...@@ -25,4 +25,4 @@ rem cd nanosupport ...@@ -25,4 +25,4 @@ rem cd nanosupport
rem nanoCase.bat rem nanoCase.bat
:: cd nanosupport :: cd nanosupport
:: nanoCase.bat :: nanoCase.bat
\ No newline at end of file
...@@ -14,7 +14,7 @@ if [ ! -n "$serverPort" ]; then ...@@ -14,7 +14,7 @@ if [ ! -n "$serverPort" ]; then
fi fi
go env -w GO111MODULE=on go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct go env -w GOPROXY=https://goproxy.cn,direct
bash ./case001/case001.sh $severIp $serverPort bash ./case001/case001.sh $severIp $serverPort
bash ./case002/case002.sh $severIp $serverPort bash ./case002/case002.sh $severIp $serverPort
......
...@@ -398,6 +398,7 @@ python3 ./test.py -f query/queryWildcardLength.py ...@@ -398,6 +398,7 @@ python3 ./test.py -f query/queryWildcardLength.py
python3 ./test.py -f query/queryTbnameUpperLower.py python3 ./test.py -f query/queryTbnameUpperLower.py
python3 ./test.py -f query/query.py python3 ./test.py -f query/query.py
python3 ./test.py -f query/queryDiffColsOr.py python3 ./test.py -f query/queryDiffColsOr.py
python3 ./test.py -f query/queryRegex.py
#======================p4-end=============== #======================p4-end===============
......
...@@ -41,6 +41,14 @@ class TDTestCase: ...@@ -41,6 +41,14 @@ class TDTestCase:
tdSql.execute( tdSql.execute(
"insert into test22 using stest tags('test21','ccc') values ('2020-09-04 16:54:54.003',210,3)") "insert into test22 using stest tags('test21','ccc') values ('2020-09-04 16:54:54.003',210,3)")
#2021-09-17 For jira: https://jira.taosdata.com:18080/browse/TD-6085
tdSql.query("select last(size),appname from stest where tbname in ('test1','test2','test11')")
tdSql.checkRows(1)
#2021-09-17 For jira: https://jira.taosdata.com:18080/browse/TD-6314
tdSql.query("select _block_dist() from stest")
tdSql.checkRows(1)
tdSql.query("select sum(size) from stest interval(1d) group by appname") tdSql.query("select sum(size) from stest interval(1d) group by appname")
tdSql.checkRows(3) tdSql.checkRows(3)
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import tdLog
from util.cases import tdCases
from util.sql import tdSql
from util.dnodes import tdDnodes
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdSql.prepare()
print("==============step1")
##2021-09-17 For jira: https://jira.taosdata.com:18080/browse/TD-6585
tdSql.execute(
"create stable if not exists stb_test(ts timestamp,c0 binary(32)) tags(t0 binary(32))"
)
tdSql.execute(
'create table if not exists stb_1 using stb_test tags("abcdefgasdfg12346")'
)
tdLog.info('insert into stb_1 values("2021-09-13 10:00:00.001","abcefdasdqwerxasdazx12345"')
tdSql.execute('insert into stb_1 values("2021-09-13 10:00:00.001","abcefdasdqwerxasdazx12345")')
tdSql.query('select * from stb_test where tbname match "asd"')
tdSql.checkRows(0)
tdSql.query('select * from stb_test where tbname nmatch "asd"')
tdSql.checkRows(1)
tdSql.query('select * from stb_test where c0 match "abc"')
tdSql.checkRows(1)
tdSql.checkData(0,1,"abcefdasdqwerxasdazx12345")
tdSql.query('select * from stb_test where c0 nmatch "abc"')
tdSql.checkRows(0)
tdSql.error('select * from stb_test where c0 match abc')
tdSql.error('select * from stb_test where c0 nmatch abc')
tdSql.execute('insert into stb_1 values("2020-10-13 10:00:00.001","abcd\\\efgh")')
tdSql.query("select * from stb_1 where c0 match '\\\\'")
tdSql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
// The test case to verfy TS-293
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <taos.h>
#include "os.h"
#include "taosdef.h"
#include "taoserror.h"
#include "tconfig.h"
#include "tglobal.h"
#include "tulog.h"
#include "tsocket.h"
#include "tutil.h"
extern SGlobalCfg *taosGetConfigOption(const char *option) ;
int main( int argc, char *argv[]){
printf("start to test\n");
//case1:
//Test config firstEp success
const char config1[128] = "{\"firstEp\":\"BCC-2:6030\",\"debugFlag\":\"135\"}";//input the parameter which want to be configured
taos_set_config(config1); //configure the parameter
SGlobalCfg *cfg ;
cfg = taosGetConfigOption("firstEp");//check the option result
if(cfg->cfgStatus != 3){ //If cfgStatus is 3,it means configure is success
printf("config firstEp 'BCC-2:6030'failures!\n");
exit(1);
}
cfg = taosGetConfigOption("debugFlag");//check the option result
if(cfg->cfgStatus != 3){
printf("config debugFlag '135' failures!\n");
exit(1);
}
//case2:
//Test config only useful at the first time
//The result is failure
const char config2[128] = "{\"fqdn\":\"BCC-3\"}";
taos_set_config(config2); //configure the parameter
cfg = taosGetConfigOption("fqdn");//check the option result
if(cfg->cfgStatus == 3){
printf("config firstEp to 'BCC-3' failures!\n");
exit(1);
}
else{
printf("test case success!\n");
exit(0);
}
return 0 ;
}
...@@ -7,7 +7,10 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt ...@@ -7,7 +7,10 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt
CFLAGS = -O0 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \ CFLAGS = -O0 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \
-Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \ -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \
-Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \ -Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \
-fsanitize=address -I../../../deps/cJson/inc -I../../../deps/cJson/inc\
-I../../../src/os/inc/ -I../../../src/inc -I../../../src/util/inc \
-I../../../src/common/inc -I../../../deps/cJson/inc
all: $(TARGET) all: $(TARGET)
...@@ -16,11 +19,19 @@ exe: ...@@ -16,11 +19,19 @@ exe:
gcc $(CFLAGS) ./stmtBatchTest.c -o $(ROOT)stmtBatchTest $(LFLAGS) gcc $(CFLAGS) ./stmtBatchTest.c -o $(ROOT)stmtBatchTest $(LFLAGS)
gcc $(CFLAGS) ./stmtTest.c -o $(ROOT)stmtTest $(LFLAGS) gcc $(CFLAGS) ./stmtTest.c -o $(ROOT)stmtTest $(LFLAGS)
gcc $(CFLAGS) ./stmt_function.c -o $(ROOT)stmt_function $(LFLAGS) gcc $(CFLAGS) ./stmt_function.c -o $(ROOT)stmt_function $(LFLAGS)
gcc $(CFLAGS) ./clientcfgtest.c -o $(ROOT)clientcfgtest $(LFLAGS)
gcc $(CFLAGS) ./openTSDBTest.c -o $(ROOT)openTSDBTest $(LFLAGS) gcc $(CFLAGS) ./openTSDBTest.c -o $(ROOT)openTSDBTest $(LFLAGS)
clean: clean:
rm $(ROOT)batchprepare rm $(ROOT)batchprepare
rm $(ROOT)stmtBatchTest rm $(ROOT)stmtBatchTest
rm $(ROOT)stmtTest rm $(ROOT)stmtTest
rm $(ROOT)stmt_function rm $(ROOT)stmt_function
rm $(ROOT)clientcfgtest
rm $(ROOT)openTSDBTest rm $(ROOT)openTSDBTest
...@@ -233,6 +233,7 @@ totalPyFailed=0 ...@@ -233,6 +233,7 @@ totalPyFailed=0
totalJDBCFailed=0 totalJDBCFailed=0
totalUnitFailed=0 totalUnitFailed=0
totalExampleFailed=0 totalExampleFailed=0
totalApiFailed=0
if [ "${OS}" == "Linux" ]; then if [ "${OS}" == "Linux" ]; then
corepath=`grep -oP '.*(?=core_)' /proc/sys/kernel/core_pattern||grep -oP '.*(?=core-)' /proc/sys/kernel/core_pattern` corepath=`grep -oP '.*(?=core_)' /proc/sys/kernel/core_pattern||grep -oP '.*(?=core-)' /proc/sys/kernel/core_pattern`
...@@ -532,7 +533,28 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" != ...@@ -532,7 +533,28 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" !=
echo "demo pass" echo "demo pass"
totalExamplePass=`expr $totalExamplePass + 1` totalExamplePass=`expr $totalExamplePass + 1`
fi fi
echo "### run setconfig tests ###"
stopTaosd
cd $tests_dir
echo "current dir: "
pwd
cd script/api
echo "building setcfgtest"
make > /dev/null
./clientcfgtest
if [ $? != "0" ]; then
echo "clientcfgtest failed"
totalExampleFailed=`expr $totalExampleFailed + 1`
else
echo "clientcfgtest pass"
totalExamplePass=`expr $totalExamplePass + 1`
fi
if [ "$totalExamplePass" -gt "0" ]; then if [ "$totalExamplePass" -gt "0" ]; then
echo -e "\n${GREEN} ### Total $totalExamplePass examples succeed! ### ${NC}" echo -e "\n${GREEN} ### Total $totalExamplePass examples succeed! ### ${NC}"
fi fi
...@@ -544,7 +566,13 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" != ...@@ -544,7 +566,13 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" !=
if [ "${OS}" == "Linux" ]; then if [ "${OS}" == "Linux" ]; then
dohavecore 1 dohavecore 1
fi fi
fi fi
exit $(($totalFailed + $totalPyFailed + $totalJDBCFailed + $totalUnitFailed + $totalExampleFailed)) exit $(($totalFailed + $totalPyFailed + $totalJDBCFailed + $totalUnitFailed + $totalExampleFailed))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册