Add a replay tool to the image
[ric-app/mc.git] / sidecars / listener / help
1 #!/usr/bin/env bash
2 # vim: ts=4 sw=4 noet:
3 #----------------------------------------------------------------------------------
4 #
5 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #          http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #
19 #---------------------------------------------------------------------------------
20
21 # provide help from the docker run command:
22 #       docker run -it --rm <container-name> help
23
24
25 cat <<endKat
26
27 The mc_listener image
28
29 Listener
30 This image contains, as the primary application, the mc_listener. Simply 
31 running the image in a container will start the listener. 
32
33
34 Replay
35 The image also contains a replay binary which has the ability to read a
36 raw data capture (rdc) file generated by the listener, and to "replay"
37 the messages by writing them to the appropriate FIFOs in the same manner
38 as the mc_listener application.  This binary is run using the run_replay.sh
39 script, and can be piped the file from the native environment:
40
41   docker run -i --rm -v /var/lib/mc/listener:/var/lib/mc/listener run_replay.sh <data-file
42
43 Alternately, if multiple data files are to be given as input, something like
44 the following can be used:
45
46   cat MLCT_* | docker run -i --rm -v /var/lib/mc/listener:/var/lib/mc/listener run_replay.sh
47
48 where 'data-file' as the rdc data. The timestamps in the original data are
49 preserved, but there is no effort to simulate the rate; messages from the raw
50 data will be written to the FIFOs as fast as possible.  The directory that
51 the replay binary should write FIFOs to should be mounted (as the example is 
52 above). If an alternate path must be used, it must be supplied using the -d path
53 command line option to run_replay.sh.  
54
55
56 endKat