Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CDS
software
advLigoRTS
Commits
d676676e
Commit
d676676e
authored
5 years ago
by
Jonathan Hanks
Browse files
Options
Downloads
Patches
Plain Diff
Adding tests for nds1 connection count limits to the ctest setup.
parent
8ee79d41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
Consumer limits
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/daqd/CMakeLists.txt
+9
-0
9 additions, 0 deletions
src/daqd/CMakeLists.txt
src/daqd/tests/test_daqd_nds_connections.sh.in
+101
-0
101 additions, 0 deletions
src/daqd/tests/test_daqd_nds_connections.sh.in
src/daqd/tests/test_nds1_connections.cc
+5
-1
5 additions, 1 deletion
src/daqd/tests/test_nds1_connections.cc
with
115 additions
and
1 deletion
src/daqd/CMakeLists.txt
+
9
−
0
View file @
d676676e
...
...
@@ -145,6 +145,9 @@ install(TARGETS daqd_shmem DESTINATION bin)
add_executable
(
test_daqd_cmask_t tests/test_main.cc
tests/test_daqd_cmask_t.cc
)
target_include_directories
(
test_daqd_cmask_t PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_test
(
NAME test_daqd_cmask_t
COMMAND test_daqd_cmask_t
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
if
(
libNDS2Client_FOUND
)
...
...
@@ -167,6 +170,12 @@ if (libNDS2Client_FOUND)
target_link_libraries
(
test_nds1_connections PUBLIC nds2client::cxx
${
CMAKE_THREAD_LIBS_INIT
}
)
configure_file
(
tests/test_daqd_nds_connections.sh.in
${
CMAKE_CURRENT_BINARY_DIR
}
/test_daqd_nds_connections.sh @ONLY
)
add_test
(
NAME test_daqd_nds_connections
COMMAND /bin/bash ./test_daqd_nds_connections.sh
WORKING_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
)
endif
(
libNDS2Client_FOUND
)
endif
(
${
DAQD_CAN_BUILD_DAQD_SHMEM
}
)
This diff is collapsed.
Click to expand it.
src/daqd/tests/test_daqd_nds_connections.sh.in
0 → 100644
+
101
−
0
View file @
d676676e
#!/bin/bash
CWD
=
"@CMAKE_CURRENT_BINARY_DIR@"
TDIR
=
""
PID_MULTI_STREAM
=
0
PID_DAQD
=
0
function
kill_proc
{
if
[
$1
-gt
0
]
;
then
echo
"Closing process
$1
"
kill
$1
fi
}
function
cleanup
{
rm
-rf
daqdrc_nds1_connection_test_final
if
[
"x
$TDIR
"
!=
"x"
]
;
then
if
[
-d
$TDIR
]
;
then
rm
-rf
"
$TDIR
"
fi
fi
kill_proc
$PID_MULTI_STREAM
kill_proc
$PID_DAQD
}
MUTLI_STREAM
=
"
$CWD
/../fe_stream_test/fe_multi_stream_test"
if
[
!
-x
"
$MUTLI_STREAM
"
]
;
then
echo
"cannot find
$MULTI_STREAM
"
exit
1
fi
DAQD
=
"
$CWD
/../daqd/daqd_shmem"
if
[
!
-x
"
$DAQD
"
]
;
then
echo
"cannot find
$DAQD
"
exit
1
fi
NDS1_CONNECTIONS_CHECK
=
"
$CWD
/test_nds1_connections"
if
[
!
-x
"
$NDS1_CONNECTIONS_CHECK
"
]
;
then
echo
"cannot find
$NDS1_CONNECTIONS_CHECK
"
exit
1
fi
if
[
!
-w
/dev/gpstime
]
;
then
echo
"the gpstime module must be loaded, configured, and accessible by this user"
exit
1
fi
if
[
!
-w
/dev/mbuf
]
;
then
echo
"the mbuf module must be loaded, configured, and accessible by this user"
exit
1
fi
PYTHON
=
""
which python
>
/dev/null
if
[
$?
-eq
0
]
;
then
PYTHON
=
`
which python
`
else
which python3
>
/dev/null
if
[
$?
-eq
0
]
;
then
PYTHON
=
`
which python3
`
else
echo
"Cannot find python or python3"
exit
1
fi
fi
trap
cleanup EXIT
TDIR
=
`
$PYTHON
-c
"from __future__ import print_function; import tempfile; print(tempfile.mkdtemp())"
`
mkdir
"
$TDIR
/ini_files"
mkdir
"
$TDIR
/logs"
echo
"Ini dir =
$TDIR
/ini_files"
"
$MUTLI_STREAM
"
-i
"
$TDIR
/ini_files"
-M
"
$TDIR
/ini_files/master"
-b
local_dc
-m
100
-k
700
-R
100
>
"
$TDIR
/logs/multi_stream"
&
PID_MULTI_STREAM
=
$!
echo
"Streamer PID = PID_MULTI_STREAM"
sleep
1
MASTER_FILE
=
"
$TDIR
/ini_files/master"
TESTPOINT_FILE
=
""
cat
daqdrc_live_test |
sed
s
\|
MASTER
\|
$MASTER_FILE
\|
|
sed
s
\|
TESTPOINT
\|
$TESTPOINT_FILE
\|
>
daqdrc_nds1_connection_test_final
"
$DAQD
"
-c
daqdrc_nds1_connection_test_final &>
"
$TDIR
/logs/daqd"
&
PID_DAQD
=
$!
echo
"Sleeping to allow the daq to start"
sleep
15
export
NDSSERVER
=
localhost:8088
"
$NDS1_CONNECTIONS_CHECK
"
RESULT
=
$?
echo
"Testing return
$RESULT
(0 = success)"
exit
$RESULT
#echo "Press enter to continue..."
#DUMMY=""
#read DUMMY
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/daqd/tests/test_nds1_connections.cc
+
5
−
1
View file @
d676676e
...
...
@@ -98,5 +98,9 @@ main( int argc, char* argv[] )
<<
std
::
endl
;
std
::
cout
<<
"We had "
<<
error
.
load
(
)
<<
" unexpected errors in the threads."
<<
std
::
endl
;
return
0
;
if
(
error
.
load
(
)
==
0
)
{
return
0
;
}
return
1
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment