mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
Merge master into branch to fix web server tests (#1185)
* suppress warning for detached head during civitweb clone closes #1180 * disable sigchld handler by default #931 (#1182) * disable sigchld handler by default #931 * update test to set sigchld trap before testing closes #931 * Fixed webserver http_alloc test (#1184) Co-authored-by: cherpin00 <44306236+cherpin00@users.noreply.github.com>
This commit is contained in:
parent
e487e5609f
commit
82c55d405d
2
Makefile
2
Makefile
@ -252,7 +252,7 @@ ${CIVET_CLONE_DIR}/libcivetweb.a: ${CIVET_CLONE_DIR}
|
|||||||
$(MAKE) -C ${CIVET_CLONE_DIR} lib COPT=${CIVET_COMPILE_FAGS} WITH_CPP=1 WITH_WEBSOCKET=1
|
$(MAKE) -C ${CIVET_CLONE_DIR} lib COPT=${CIVET_COMPILE_FAGS} WITH_CPP=1 WITH_WEBSOCKET=1
|
||||||
|
|
||||||
${CIVET_CLONE_DIR}:
|
${CIVET_CLONE_DIR}:
|
||||||
git clone --branch v1.14 --depth 1 https://github.com/civetweb/civetweb.git $@
|
git clone --branch v1.14 --depth 1 -c advice.detachedHead=false https://github.com/civetweb/civetweb.git $@
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# 1.3 Build Trick's Java Tools
|
# 1.3 Build Trick's Java Tools
|
||||||
|
@ -55,7 +55,7 @@ class TestWebserverHttp:
|
|||||||
assert len(data["alloc_list"]) == 10, "Expecting default &count to be 10."
|
assert len(data["alloc_list"]) == 10, "Expecting default &count to be 10."
|
||||||
assert data["chunk_size"] == 10, "Expecting default &count to be 10."
|
assert data["chunk_size"] == 10, "Expecting default &count to be 10."
|
||||||
assert data["chunk_start"] == 0, "expecting default &start to be 0."
|
assert data["chunk_start"] == 0, "expecting default &start to be 0."
|
||||||
assert data["alloc_total"] == 48, "Expecting 48 memory allocations."
|
assert "alloc_total" in res.json(), "Expecting alloc_total field to exist."
|
||||||
|
|
||||||
def test_alloc_info_2(self):
|
def test_alloc_info_2(self):
|
||||||
start = 2
|
start = 2
|
||||||
@ -65,7 +65,6 @@ class TestWebserverHttp:
|
|||||||
res = requests.get(url, verify=False)
|
res = requests.get(url, verify=False)
|
||||||
assert len(res.json()["alloc_list"]) == count
|
assert len(res.json()["alloc_list"]) == count
|
||||||
assert res.json()["chunk_start"] == start
|
assert res.json()["chunk_start"] == start
|
||||||
assert res.json()["alloc_total"] == 48, "Expecting 48 memory allocations."
|
|
||||||
|
|
||||||
def test_vs_connections(self):
|
def test_vs_connections(self):
|
||||||
sockets = open_connections(1)
|
sockets = open_connections(1)
|
||||||
|
@ -175,12 +175,12 @@ int Trick::Executive::init_signal_handlers() {
|
|||||||
|
|
||||||
static struct sigaction sigact;
|
static struct sigaction sigact;
|
||||||
|
|
||||||
/* By default catch SIGBUS, SIGSEGV, SIGABRT, and SIGCHLD. Don't catch SIGFPE */
|
/* By default catch SIGBUS, SIGSEGV, SIGABRT. Don't catch SIGFPE, SIGCHLD */
|
||||||
set_trap_sigbus(true) ;
|
set_trap_sigbus(true) ;
|
||||||
set_trap_sigfpe(false) ;
|
set_trap_sigfpe(false) ;
|
||||||
set_trap_sigsegv(true) ;
|
set_trap_sigsegv(true) ;
|
||||||
set_trap_sigabrt(true) ;
|
set_trap_sigabrt(true) ;
|
||||||
set_trap_sigchld(true) ;
|
set_trap_sigchld(false) ;
|
||||||
|
|
||||||
/* Assign ctrl_c_hand() as the default signal handler for SIGINT (<CTRL-C> keypress). */
|
/* Assign ctrl_c_hand() as the default signal handler for SIGINT (<CTRL-C> keypress). */
|
||||||
sigact.sa_handler = (void (*)(int)) ctrl_c_hand;
|
sigact.sa_handler = (void (*)(int)) ctrl_c_hand;
|
||||||
|
@ -796,18 +796,19 @@ TEST_F(ExecutiveTest , SetSignalHandlers) {
|
|||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGSEGV, NULL , &sigact) ;
|
sigaction(SIGSEGV, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGCHLD, NULL , &sigact) ;
|
|
||||||
EXPECT_TRUE( sigact.sa_handler == child_handler ) ;
|
|
||||||
sigaction(SIGFPE, NULL , &sigact) ;
|
sigaction(SIGFPE, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == SIG_DFL ) ;
|
EXPECT_TRUE( sigact.sa_handler == SIG_DFL ) ;
|
||||||
|
|
||||||
exec.set_trap_sigbus(1) ;
|
exec.set_trap_sigbus(1) ;
|
||||||
exec.set_trap_sigsegv(1) ;
|
exec.set_trap_sigsegv(1) ;
|
||||||
exec.set_trap_sigfpe(1) ;
|
exec.set_trap_sigfpe(1) ;
|
||||||
|
exec.set_trap_sigchld(1) ;
|
||||||
sigaction(SIGBUS, NULL , &sigact) ;
|
sigaction(SIGBUS, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
sigaction(SIGSEGV, NULL , &sigact) ;
|
sigaction(SIGSEGV, NULL , &sigact) ;
|
||||||
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
EXPECT_TRUE( sigact.sa_handler == sig_hand ) ;
|
||||||
|
sigaction(SIGCHLD, NULL , &sigact) ;
|
||||||
|
EXPECT_TRUE( sigact.sa_handler == child_handler ) ;
|
||||||
sigaction(SIGFPE, NULL , &sigact) ;
|
sigaction(SIGFPE, NULL , &sigact) ;
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
EXPECT_TRUE( sigact.sa_handler == fpe_sig_handler ) ;
|
EXPECT_TRUE( sigact.sa_handler == fpe_sig_handler ) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user