Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | # |
| 3 | # socket_test.sh -- script to run socket tests. |
| 4 | # |
| 5 | script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 6 | vpp_dir="$WS_ROOT/build-root/install-vpp-native/vpp/bin/" |
| 7 | vpp_debug_dir="$WS_ROOT/build-root/install-vpp_debug-native/vpp/bin/" |
| 8 | vpp_shm_dir="/dev/shm/" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 9 | vpp_run_dir="/run/vpp" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 10 | lib64_dir="$WS_ROOT/build-root/install-vpp-native/vpp/lib64/" |
| 11 | lib64_debug_dir="$WS_ROOT/build-root/install-vpp_debug-native/vpp/lib64/" |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 12 | dpdk_devbind="/usr/share/dpdk/usertools/dpdk-devbind.py" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 13 | docker_vpp_dir="/vpp/" |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 14 | docker_app_dir="/vpp/" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 15 | docker_lib64_dir="/vpp-lib64/" |
| 16 | docker_os="ubuntu" |
Dave Wallace | d69f4f4 | 2017-08-14 18:26:46 -0400 | [diff] [blame] | 17 | vcl_ldpreload_lib="libvcl_ldpreload.so.0.0.0" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 18 | user_gid="$(id -g)" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 19 | vpp_app="vpp" |
| 20 | sock_srvr_app="sock_test_server" |
| 21 | sock_clnt_app="sock_test_client" |
| 22 | sock_srvr_addr="127.0.0.1" |
| 23 | sock_srvr_port="22000" |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 24 | iperf_srvr_app="iperf3 -V4d -s" |
| 25 | iperf_clnt_app="iperf3 -V4d -c \$srvr_addr" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 26 | gdb_in_emacs="gdb_in_emacs" |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 27 | vcl_config="vcl.conf" |
| 28 | vcl_config_dir="$WS_ROOT/src/vcl/" |
| 29 | docker_vcl_config_dir="/etc/vpp/" |
Keith Burns (alagalah) | 9e482bb | 2017-08-30 14:06:52 -0700 | [diff] [blame] | 30 | xterm_geom="100x60" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 31 | bash_header="#! /bin/bash" |
| 32 | tmp_cmdfile_prefix="/tmp/socket_test_cmd" |
| 33 | cmd1_file="${tmp_cmdfile_prefix}1.$$" |
| 34 | cmd2_file="${tmp_cmdfile_prefix}2.$$" |
| 35 | cmd3_file="${tmp_cmdfile_prefix}3.$$" |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 36 | vpp_eth_name="enp0s8" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 37 | tmp_vpp_exec_file="/tmp/vpp_config.$$" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 38 | tmp_gdb_cmdfile_prefix="/tmp/gdb_cmdfile" |
| 39 | def_gdb_cmdfile_prefix="$WS_ROOT/extras/gdb/gdb_cmdfile" |
| 40 | tmp_gdb_cmdfile_vpp="${tmp_gdb_cmdfile_prefix}_vpp.$$" |
| 41 | tmp_gdb_cmdfile_client="${tmp_gdb_cmdfile_prefix}_vcl_client.$$" |
| 42 | tmp_gdb_cmdfile_server="${tmp_gdb_cmdfile_prefix}_vcl_server.$$" |
| 43 | get_docker_server_ip4addr='srvr_addr=$(docker network inspect bridge | grep IPv4Address | awk -e '\''{print $2}'\'' | sed -e '\''s,/16,,'\'' -e '\''s,",,g'\'' -e '\''s/,//'\'')' |
| 44 | #' single quote to fix the confused emacs colorizer. |
| 45 | trap_signals="SIGINT SIGTERM EXIT" |
| 46 | |
| 47 | # Set default values for imported environment variables if they don't exist. |
| 48 | # |
| 49 | VPP_GDB_CMDFILE="${VPP_GDB_CMDFILE:-${def_gdb_cmdfile_prefix}.vpp}" |
| 50 | VPPCOM_CLIENT_GDB_CMDFILE="${VPPCOM_CLIENT_GDB_CMDFILE:-${def_gdb_cmdfile_prefix}.vppcom_client}" |
| 51 | VPPCOM_SERVER_GDB_CMDFILE="${VPPCOM_SERVER_GDB_CMDFILE:-${def_gdb_cmdfile_prefix}.vppcom_server}" |
| 52 | |
| 53 | usage() { |
| 54 | cat <<EOF |
| 55 | Usage: socket_test.sh OPTIONS TEST |
| 56 | TESTS: |
| 57 | nk, native-kernel Run server & client on host using kernel. |
| 58 | nv, native-vcl Run vpp, server & client on host using VppComLib. |
| 59 | np, native-preload Run vpp, server & client on host using LD_PRELOAD. |
| 60 | dk, docker-kernel Run server & client in docker using kernel stack. |
| 61 | dv, docker-vcl Run vpp on host, server & client in docker using VppComLib. |
| 62 | dp, docker-preload Run vpp on host, server & client in docker using LD_PRELOAD. |
| 63 | |
| 64 | OPTIONS: |
| 65 | -h Print this usage text. |
| 66 | -l Leave ${tmp_cmdfile_prefix}* files after test run. |
| 67 | -b Run bash after application exit. |
| 68 | -d Run the vpp_debug version of all apps. |
Dave Wallace | 774169b | 2017-11-01 20:07:40 -0400 | [diff] [blame] | 69 | -c Set VCL_CONFIG to use the vcl_test.conf file. |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 70 | -i Run iperf3 for client/server app in native tests. |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 71 | -n Name of ethernet for VPP to use in multi-host cfg. |
| 72 | -6 Use ipv6 addressing. |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 73 | -m c[lient] Run client in multi-host cfg (server on remote host) |
| 74 | s[erver] Run server in multi-host cfg (client on remote host) |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 75 | -e a[ll] Run all in emacs+gdb. |
| 76 | c[lient] Run client in emacs+gdb. |
| 77 | s[erver] Run server in emacs+gdb. |
| 78 | v[pp] Run vpp in emacs+gdb. |
| 79 | -g a[ll] Run all in gdb. |
| 80 | c[lient] Run client in gdb. |
| 81 | s[erver] Run server in gdb. |
| 82 | v[pp] Run vpp in gdb. |
| 83 | -t Use tabs in one xterm if available (e.g. xfce4-terminal). |
| 84 | |
| 85 | OPTIONS passed to client/server: |
| 86 | -S <ip address> Server IP address. |
| 87 | -P <server port> Server Port number. |
| 88 | -E <data> Run Echo test. |
| 89 | -N <num-writes> Test Cfg: number of writes. |
| 90 | -R <rxbuf-size> Test Cfg: rx buffer size. |
| 91 | -T <txbuf-size> Test Cfg: tx buffer size. |
| 92 | -U Run Uni-directional test. |
| 93 | -B Run Bi-directional test. |
| 94 | -I <num-tst-socks> Send data over multiple test sockets in parallel. |
| 95 | -V Test Cfg: Verbose mode. |
| 96 | -X Exit client/server after running test. |
| 97 | |
| 98 | Environment variables: |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 99 | VCL_CONFIG Pathname of vppcom configuration file. |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 100 | VPP_GDB_CMDFILE Pathname of gdb command file for vpp. |
| 101 | VPPCOM_CLIENT_GDB_CMDFILE Pathname of gdb command file for client. |
| 102 | VPPCOM_SERVER_GDB_CMDFILE Pathname of gdb command file for server. |
| 103 | EOF |
| 104 | exit 1 |
| 105 | } |
| 106 | |
| 107 | declare -i emacs_vpp=0 |
| 108 | declare -i emacs_client=0 |
| 109 | declare -i emacs_server=0 |
| 110 | declare -i gdb_vpp=0 |
| 111 | declare -i gdb_client=0 |
| 112 | declare -i gdb_server=0 |
| 113 | declare -i perf_vpp=0 |
| 114 | declare -i perf_client=0 |
| 115 | declare -i perf_server=0 |
| 116 | declare -i leave_tmp_files=0 |
| 117 | declare -i bash_after_exit=0 |
| 118 | declare -i iperf3=0 |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 119 | declare -i use_ipv6=0 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 120 | |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 121 | while getopts ":hitlbcd6n:m:e:g:p:E:I:N:P:R:S:T:UBVX" opt; do |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 122 | case $opt in |
| 123 | h) usage ;; |
| 124 | l) leave_tmp_files=1 |
| 125 | ;; |
| 126 | b) bash_after_exit=1 |
| 127 | ;; |
| 128 | i) iperf3=1 |
| 129 | ;; |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 130 | 6) use_ipv6=1 |
| 131 | ;; |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 132 | t) xterm_geom="180x40" |
| 133 | use_tabs="true" |
| 134 | ;; |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 135 | c) VCL_CONFIG="${vcl_config_dir}vcl_test.conf" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 136 | ;; |
| 137 | d) title_dbg="-DEBUG" |
| 138 | vpp_dir=$vpp_debug_dir |
| 139 | lib64_dir=$lib64_debug_dir |
| 140 | ;; |
| 141 | e) if [ $OPTARG = "a" ] || [ $OPTARG = "all" ] ; then |
| 142 | emacs_client=1 |
| 143 | emacs_server=1 |
| 144 | emacs_vpp=1 |
| 145 | elif [ $OPTARG = "c" ] || [ $OPTARG = "client" ] ; then |
| 146 | emacs_client=1 |
| 147 | elif [ $OPTARG = "s" ] || [ $OPTARG = "server" ] ; then |
| 148 | emacs_server=1 |
| 149 | elif [ $OPTARG = "v" ] || [ $OPTARG = "vpp" ] ; then |
| 150 | emacs_vpp=1 |
| 151 | else |
| 152 | echo "ERROR: Option -e unknown argument \'$OPTARG\'" >&2 |
| 153 | usage |
| 154 | fi |
| 155 | title_dbg="-DEBUG" |
| 156 | vpp_dir=$vpp_debug_dir |
| 157 | lib64_dir=$lib64_debug_dir |
| 158 | ;; |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 159 | n) vpp_eth_name="$OPTARG" |
| 160 | ;; |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 161 | m) if [ $OPTARG = "c" ] || [ $OPTARG = "client" ] ; then |
| 162 | multi_host="client" |
| 163 | elif [ $OPTARG = "s" ] || [ $OPTARG = "server" ] ; then |
| 164 | multi_host="server" |
| 165 | else |
| 166 | echo "ERROR: Option -e unknown argument \'$OPTARG\'" >&2 |
| 167 | usage |
| 168 | fi |
| 169 | ;; |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 170 | g) if [ $OPTARG = "a" ] || [ $OPTARG = "all" ] ; then |
| 171 | gdb_client=1 |
| 172 | gdb_server=1 |
| 173 | gdb_vpp=1 |
| 174 | elif [ $OPTARG = "c" ] || [ $OPTARG = "client" ] ; then |
| 175 | gdb_client=1 |
| 176 | elif [ $OPTARG = "s" ] || [ $OPTARG = "server" ] ; then |
| 177 | gdb_server=1 |
| 178 | elif [ $OPTARG = "v" ] || [ $OPTARG = "vpp" ] ; then |
| 179 | gdb_vpp=1 |
| 180 | else |
| 181 | echo "ERROR: Option -g unknown argument \'$OPTARG\'" >&2 |
| 182 | usage |
| 183 | fi |
| 184 | title_dbg="-DEBUG" |
| 185 | vpp_dir=$vpp_debug_dir |
| 186 | lib64_dir=$lib64_debug_dir |
| 187 | ;; |
| 188 | p) if [ $OPTARG = "a" ] || [ $OPTARG = "all" ] ; then |
| 189 | perf_client=1 |
| 190 | perf_server=1 |
| 191 | perf_vpp=1 |
| 192 | elif [ $OPTARG = "c" ] || [ $OPTARG = "client" ] ; then |
| 193 | perf_client=1 |
| 194 | elif [ $OPTARG = "s" ] || [ $OPTARG = "server" ] ; then |
| 195 | perf_server=1 |
| 196 | elif [ $OPTARG = "v" ] || [ $OPTARG = "vpp" ] ; then |
| 197 | perf_vpp=1 |
| 198 | else |
| 199 | echo "ERROR: Option -p unknown argument \'$OPTARG\'" >&2 |
| 200 | usage |
| 201 | fi |
| 202 | echo "WARNING: -p options TBD" |
| 203 | ;; |
| 204 | S) sock_srvr_addr="$OPTARG" |
| 205 | ;; |
| 206 | P) sock_srvr_port="$OPTARG" |
| 207 | ;; |
| 208 | E|I|N|R|T) sock_clnt_options="$sock_clnt_options -$opt \"$OPTARG\"" |
| 209 | ;; |
| 210 | U|B|V|X) sock_clnt_options="$sock_clnt_options -$opt" |
| 211 | ;; |
| 212 | \?) |
| 213 | echo "ERROR: Invalid option: -$OPTARG" >&2 |
| 214 | usage |
| 215 | ;; |
| 216 | :) |
| 217 | echo "ERROR: Option -$OPTARG requires an argument." >&2 |
| 218 | usage |
| 219 | ;; |
| 220 | esac |
| 221 | done |
| 222 | |
| 223 | shift $(( $OPTIND-1 )) |
| 224 | while ! [[ $run_test ]] && (( $# > 0 )) ; do |
| 225 | case $1 in |
| 226 | "nk" | "native-kernel") |
| 227 | run_test="native_kernel" ;; |
| 228 | "np" | "native-preload") |
| 229 | run_test="native_preload" ;; |
| 230 | "nv" | "native-vcl") |
| 231 | sock_srvr_app="vcl_test_server" |
| 232 | sock_clnt_app="vcl_test_client" |
| 233 | run_test="native_vcl" ;; |
| 234 | "dk" | "docker-kernel") |
| 235 | run_test="docker_kernel" ;; |
| 236 | "dp" | "docker-preload") |
| 237 | run_test="docker_preload" ;; |
| 238 | "dv" | "docker-vcl") |
| 239 | sock_srvr_app="vcl_test_server" |
| 240 | sock_clnt_app="vcl_test_client" |
| 241 | run_test="docker_vcl" ;; |
| 242 | *) |
| 243 | echo "ERROR: Unknown option '$1'!" >&2 |
| 244 | usage ;; |
| 245 | esac |
| 246 | shift |
| 247 | done |
| 248 | |
Dave Wallace | ee45d41 | 2017-11-24 21:44:06 -0500 | [diff] [blame] | 249 | if [ -z "$VCL_DEBUG" ] ; then |
| 250 | if [ "$title_dbg" = "-DEBUG" ] ; then |
| 251 | VCL_DEBUG=1 |
| 252 | else |
| 253 | VCL_DEBUG=0 |
| 254 | fi |
| 255 | fi |
| 256 | |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 257 | VCL_LDPRELOAD_LIB_DIR="${VCL_LDPRELOAD_LIB_DIR:-$lib64_dir}" |
| 258 | |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 259 | if [ -z "$WS_ROOT" ] ; then |
| 260 | echo "ERROR: WS_ROOT environment variable not set!" >&2 |
| 261 | echo " Please set WS_ROOT to VPP workspace root directory." >&2 |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 262 | exit 1 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 263 | fi |
| 264 | |
Dave Wallace | 4f6c3a9 | 2017-10-24 15:39:44 -0400 | [diff] [blame] | 265 | if [[ "$(grep bin_PROGRAMS $WS_ROOT/src/vcl.am)" = "" ]] ; then |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 266 | $WS_ROOT/extras/vagrant/vcl_test.sh $WS_ROOT $USER |
| 267 | (cd $WS_ROOT; make build) |
| 268 | fi |
| 269 | |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 270 | if [ ! -d $vpp_dir ] ; then |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 271 | echo "ERROR: Missing VPP$title_dbg bin directory!" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 272 | echo " $vpp_dir" >&2 |
| 273 | env_test_failed="true" |
| 274 | fi |
| 275 | |
| 276 | if [[ $run_test =~ .*"_preload" ]] ; then |
| 277 | if [ ! -d $lib64_dir ] ; then |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 278 | echo "ERROR: Missing VPP$title_dbg lib64 directory!" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 279 | echo " $lib64_dir" >&2 |
Dave Wallace | d69f4f4 | 2017-08-14 18:26:46 -0400 | [diff] [blame] | 280 | elif [ ! -d $VCL_LDPRELOAD_LIB_DIR ] ; then |
| 281 | echo "ERROR: Missing VCL LD_PRELOAD Library directory!" >&2 |
| 282 | echo " $VCL_LDPRELOAD_LIB_DIR" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 283 | env_test_failed="true" |
Dave Wallace | d69f4f4 | 2017-08-14 18:26:46 -0400 | [diff] [blame] | 284 | elif [ ! -f $VCL_LDPRELOAD_LIB_DIR/$vcl_ldpreload_lib ] ; then |
| 285 | echo "ERROR: Missing VCL LD_PRELOAD library!" >&2 |
| 286 | echo " $VCL_LDPRELOAD_LIB_DIR/$vcl_ldpreload_lib" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 287 | env_test_failed="true" |
| 288 | fi |
| 289 | fi |
| 290 | |
| 291 | if [ ! -f $vpp_dir$vpp_app ] ; then |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 292 | echo "ERROR: Missing VPP$title_dbg Application!" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 293 | echo " $vpp_dir$vpp_app" >&2 |
| 294 | env_test_failed="true" |
| 295 | fi |
| 296 | |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 297 | if [ ! -f $vpp_dir$sock_srvr_app ] && [ ! $iperf3 -eq 1 ] ; then |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 298 | echo "ERROR: Missing$title_dbg Socket Server Application!" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 299 | echo " $vpp_dir$sock_srvr_app" >&2 |
| 300 | env_test_failed="true" |
| 301 | fi |
| 302 | |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 303 | if [ ! -f $vpp_dir$sock_clnt_app ] && [ ! $iperf3 -eq 1 ] ; then |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 304 | echo "ERROR: Missing$title_dbg Socket Client Application!" >&2 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 305 | echo " $vpp_dir$sock_clnt_app" >&2 |
| 306 | env_test_failed="true" |
| 307 | fi |
| 308 | |
| 309 | if [[ $run_test =~ "docker_".* ]] ; then |
| 310 | if [ $emacs_client -eq 1 ] || [ $emacs_server -eq 1 ] || [ $gdb_client -eq 1 ] || [ $gdb_server -eq 1 ] ; then |
| 311 | |
| 312 | echo "WARNING: gdb is not currently supported in docker." |
| 313 | echo " Ignoring client/server gdb options." |
| 314 | emacs_client=0 |
| 315 | emacs_server=0 |
| 316 | gdb_client=0 |
| 317 | gdb_server=0 |
| 318 | fi |
| 319 | fi |
| 320 | |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 321 | if [[ $run_test =~ .*"_vcl" ]] && [ $iperf3 -eq 1 ] ; then |
| 322 | echo "ERROR: Invalid option 'i' for test $run_test!" |
| 323 | echo " iperf3 is not compiled with the VCL library." |
| 324 | env_test_failed="true" |
| 325 | fi |
| 326 | |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 327 | if [ -n "$mult_host"] && [ ! -f "$dpdk_devbind" ] ; then |
| 328 | echo "ERROR: Can't find dpdk-devbind.py!" |
| 329 | echo " Run \"cd \$WS_ROOT; make dpdk-install-dev\" to install it." |
| 330 | echo |
| 331 | env_test_failed="true" |
| 332 | fi |
| 333 | |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 334 | if [ -n "$env_test_failed" ] ; then |
| 335 | exit 1 |
| 336 | fi |
| 337 | |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 338 | if [ -f "$VCL_CONFIG" ] ; then |
| 339 | vcl_config="$(basename $VCL_CONFIG)" |
| 340 | vcl_config_dir="$(dirname $VCL_CONFIG)/" |
| 341 | api_prefix="$(egrep -s '^\s*api-prefix \w+' $VCL_CONFIG | tail -1 | awk -e '{print $2}')" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 342 | if [ -n "$api_prefix" ] ; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 343 | api_segment=" api-segment { gid $user_gid prefix $api_prefix }" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 344 | fi |
| 345 | fi |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 346 | if [ -n "$VCL_APP_NAMESPACE_ID" ] && [ -n "$VCL_APP_NAMESPACE_SECRET" ] ; then |
| 347 | namespace_id="$VCL_APP_NAMESPACE_ID" |
| 348 | namespace_secret="$VCL_APP_NAMESPACE_SECRET" |
| 349 | fi |
| 350 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 351 | if [ -z "$api_segment" ] ; then |
| 352 | api_segment=" api-segment { gid $user_gid }" |
| 353 | fi |
Dave Wallace | 498b3a5 | 2017-11-09 13:00:34 -0500 | [diff] [blame] | 354 | vpp_args="unix { interactive full-coredump coredump-size unlimited exec $tmp_vpp_exec_file}${api_segment}" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 355 | |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 356 | if [ $iperf3 -eq 1 ] ; then |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 357 | app_dir="$(dirname $(which iperf3))/" |
| 358 | srvr_app=$iperf_srvr_app |
| 359 | clnt_app=$iperf_clnt_app |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 360 | if [[ $run_test =~ "docker_".* ]] ; then |
| 361 | unset -v app_dir |
| 362 | sock_srvr_port=5201 |
| 363 | docker_app_dir="networkstatic/" |
| 364 | unset -v docker_os |
| 365 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 366 | else |
| 367 | app_dir="$vpp_dir" |
| 368 | srvr_app="$sock_srvr_app $sock_srvr_port" |
| 369 | clnt_app="$sock_clnt_app${sock_clnt_options} \$srvr_addr $sock_srvr_port" |
| 370 | fi |
| 371 | |
Dave Wallace | 5c7cf1c | 2017-10-24 04:12:18 -0400 | [diff] [blame] | 372 | |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 373 | verify_no_vpp() { |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 374 | local grep_for_vpp="ps -eaf|grep -v grep|grep \"bin/vpp\"" |
| 375 | |
| 376 | if [ -n "$api_prefix" ] ; then |
| 377 | grep_for_vpp="$grep_for_vpp|grep \"prefix $api_prefix\"" |
| 378 | fi |
| 379 | local running_vpp="$(eval $grep_for_vpp)" |
| 380 | if [ -n "$running_vpp" ] ; then |
| 381 | echo "ERROR: Please kill the following vpp instance(s):" |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 382 | echo |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 383 | echo $running_vpp |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 384 | echo |
| 385 | exit 1 |
| 386 | fi |
| 387 | clean_devshm="$vpp_shm_dir*db $vpp_shm_dir*global_vm $vpp_shm_dir*vpe-api $vpp_shm_dir[0-9]*-[0-9]* $vpp_shm_dir*:segment[0-9]*" |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 388 | sudo rm -f $clean_devshm |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 389 | devshm_files="$(ls -l $clean_devshm 2>/dev/null | grep $(whoami))" |
| 390 | if [ "$devshm_files" != "" ] ; then |
| 391 | echo "ERROR: Please remove the following $vpp_shm_dir files:" |
| 392 | for file in "$devshm_files" ; do |
| 393 | echo " $file" |
| 394 | done |
| 395 | exit 1 |
| 396 | fi |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 397 | if [ ! -d "$vpp_run_dir" ] ; then |
| 398 | sudo mkdir $vpp_run_dir |
| 399 | sudo chown root:$USER $vpp_run_dir |
| 400 | fi |
| 401 | if [ -n "$multi_host" ] ; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 402 | vpp_eth_pci_id="$(ls -ld /sys/class/net/$vpp_eth_name/device | awk '{print $11}' | cut -d/ -f4)" |
| 403 | if [ -z "$vpp_eth_pci_id" ] ; then |
| 404 | echo "ERROR: Missing ethernet interface $vpp_eth_name!" |
| 405 | usage |
| 406 | fi |
| 407 | printf -v bus "%x" "0x$(echo $vpp_eth_pci_id | cut -d: -f2)" |
| 408 | printf -v slot "%x" "0x$(echo $vpp_eth_pci_id | cut -d: -f3 | cut -d. -f1)" |
| 409 | printf -v func "%x" "0x$(echo $vpp_eth_pci_id | cut -d. -f2)" |
| 410 | |
| 411 | vpp_eth_kernel_driver="$(basename $(ls -l /sys/bus/pci/devices/$vpp_eth_pci_id/driver | awk '{print $11}'))" |
| 412 | if [ -z "$vpp_eth_kernel_driver" ] ; then |
| 413 | echo "ERROR: Missing kernel driver for $vpp_eth_name!" |
| 414 | usage |
| 415 | fi |
| 416 | case $vpp_eth_kernel_driver in |
| 417 | e1000) |
| 418 | vpp_eth_ifname="GigabitEthernet$bus/$slot/$func" ;; |
| 419 | ixgbe) |
| 420 | vpp_eth_ifname="TenGigabitEthernet$bus/$slot/$func" ;; |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 421 | i40e) |
| 422 | vpp_eth_ifname="FortyGigabitEthernet$bus/$slot/$func" ;; |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 423 | *) |
| 424 | echo "ERROR: Unknown ethernet kernel driver $vpp_eth_kernel_driver!" |
| 425 | usage ;; |
| 426 | esac |
| 427 | |
| 428 | vpp_eth_ip4_addr="$(ip -4 -br addr show $vpp_eth_name | awk '{print $3}')" |
| 429 | if [ -z "$vpp_eth_ip4_addr" ] ; then |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 430 | if [ "$multi_host" = "server" ] ; then |
| 431 | vpp_eth_ip4_addr="10.10.10.10/24" |
| 432 | else |
| 433 | vpp_eth_ip4_addr="10.10.10.11/24" |
| 434 | fi |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 435 | fi |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 436 | if [ $use_ipv6 -eq 1 ] && [ -z "$vpp_eth_ip6_addr" ] ; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 437 | echo "ERROR: No inet6 address configured for $vpp_eth_name!" |
| 438 | usage |
| 439 | fi |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 440 | vpp_args="$vpp_args plugins { path ${lib64_dir}vpp_plugins } dpdk { dev $vpp_eth_pci_id }" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 441 | |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 442 | sudo ifconfig $vpp_eth_name down 2> /dev/null |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 443 | echo "Configuring VPP to use $vpp_eth_name ($vpp_eth_pci_id), inet addr $vpp_eth_ip4_addr" |
| 444 | |
| 445 | cat <<EOF >> $tmp_vpp_exec_file |
| 446 | set int state $vpp_eth_ifname up |
| 447 | set int ip addr $vpp_eth_ifname $vpp_eth_ip4_addr |
| 448 | EOF |
| 449 | |
| 450 | fi |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 451 | |
| 452 | if [ -n "$namespace_id" ] ; then |
| 453 | cat <<EOF >> $tmp_vpp_exec_file |
| 454 | session enable |
| 455 | app ns add id $namespace_id secret $namespace_secret sw_if_index 0 |
| 456 | EOF |
| 457 | fi |
| 458 | |
| 459 | cat <<EOF >> $tmp_vpp_exec_file |
| 460 | show version |
| 461 | show version verbose |
| 462 | show cpu |
| 463 | show int |
| 464 | EOF |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | verify_no_docker_containers() { |
| 468 | if (( $(which docker | wc -l) < 1 )) ; then |
| 469 | echo "ERROR: docker is not installed!" |
| 470 | echo "See https://docs.docker.com/engine/installation/linux/ubuntu/" |
| 471 | echo " or https://docs.docker.com/engine/installation/linux/centos/" |
| 472 | exit 1 |
| 473 | fi |
| 474 | if (( $(docker ps | wc -l) > 1 )) ; then |
| 475 | echo "ERROR: Run the following to kill all docker containers:" |
| 476 | echo "docker kill \$(docker ps -q)" |
| 477 | echo |
| 478 | docker ps |
| 479 | exit 1 |
| 480 | fi |
| 481 | } |
| 482 | |
| 483 | set_pre_cmd() { |
| 484 | # arguments |
| 485 | # $1 : emacs flag |
| 486 | # $2 : gdb flag |
| 487 | # $3 : optional LD_PRELOAD library pathname |
| 488 | local -i emacs=$1 |
| 489 | local -i gdb=$2 |
| 490 | |
| 491 | if [ $emacs -eq 1 ] ; then |
| 492 | write_gdb_cmdfile $tmp_gdb_cmdfile $gdb_cmdfile $emacs $3 |
| 493 | pre_cmd="$gdb_in_emacs " |
| 494 | elif [ $gdb -eq 1 ] ; then |
| 495 | write_gdb_cmdfile $tmp_gdb_cmdfile $gdb_cmdfile $emacs $3 |
Dave Wallace | 4878cbe | 2017-11-21 03:45:09 -0500 | [diff] [blame] | 496 | pre_cmd="gdb -x $tmp_gdb_cmdfile --args " |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 497 | elif [ -z $3 ] ; then |
| 498 | unset -v pre_cmd |
| 499 | else |
| 500 | docker_ld_preload="-e LD_PRELOAD=$3 " |
| 501 | pre_cmd="LD_PRELOAD=$3 " |
| 502 | fi |
| 503 | } |
| 504 | |
| 505 | write_script_header() { |
| 506 | # arguments |
| 507 | # $1 : command script file |
| 508 | # $2 : gdb command file |
| 509 | # $3 : title |
| 510 | # $4 : optional command string (typically "sleep 2") |
| 511 | echo "$bash_header" > $1 |
| 512 | echo -e "#\n# $1 generated on $(date)\n#" >> $1 |
| 513 | if [ $leave_tmp_files -eq 0 ] ; then |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 514 | if [ -n "$multi_host" ] ; then |
| 515 | echo "trap \"rm -f $1 $2 $tmp_vpp_exec_file; sudo $dpdk_devbind -b $vpp_eth_kernel_driver $vpp_eth_pci_id; sudo ifconfig $vpp_eth_name up\" $trap_signals" >> $1 |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 516 | else |
| 517 | echo "trap \"rm -f $1 $2 $tmp_vpp_exec_file\" $trap_signals" >> $1 |
| 518 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 519 | fi |
Dave Wallace | 498b3a5 | 2017-11-09 13:00:34 -0500 | [diff] [blame] | 520 | if [ -n "$VCL_CONFIG" ] ; then |
| 521 | echo "export VCL_CONFIG=${vcl_config_dir}${vcl_config}" >> $1 |
| 522 | fi |
| 523 | if [ -n "$VCL_DEBUG" ] ; then |
| 524 | echo "export VCL_DEBUG=$VCL_DEBUG" >> $1 |
| 525 | fi |
Dave Wallace | 048b1d6 | 2018-01-03 22:24:41 -0500 | [diff] [blame] | 526 | if [ -n "$VCOM_DEBUG" ] ; then |
| 527 | echo "export VCOM_DEBUG=$VCOM_DEBUG" >> $1 |
| 528 | fi |
| 529 | if [ -n "$VCOM_APP_NAME" ] ; then |
| 530 | echo "export VCOM_APP_NAME=$VCOM_APP_NAME" >> $1 |
| 531 | fi |
| 532 | if [ -n "$VCOM_SID_BIT" ] ; then |
| 533 | echo "export VCOM_SID_BIT=$VCOM_SID_BIT" >> $1 |
| 534 | fi |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 535 | if [ -n "$namespace_id" ] ; then |
| 536 | echo "export VCL_APP_NAMESPACE_ID=\"$namespace_id\"" >> $1 |
| 537 | echo "export VCL_APP_NAMESPACE_SECRET=\"$namespace_secret\"" >> $1 |
| 538 | fi |
Dave Wallace | e695cb4 | 2017-11-02 22:04:42 -0400 | [diff] [blame] | 539 | if [ -n "$VCL_APP_SCOPE_LOCAL" ] || [ -z "$multi_host" ] ; then |
Dave Wallace | 774169b | 2017-11-01 20:07:40 -0400 | [diff] [blame] | 540 | echo "export VCL_APP_SCOPE_LOCAL=true" >> $1 |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 541 | fi |
Dave Wallace | e695cb4 | 2017-11-02 22:04:42 -0400 | [diff] [blame] | 542 | if [ -n "$VCL_APP_SCOPE_GLOBAL" ] || [ -n "$multi_host" ] ; then |
Dave Wallace | 774169b | 2017-11-01 20:07:40 -0400 | [diff] [blame] | 543 | echo "export VCL_APP_SCOPE_GLOBAL=true" >> $1 |
| 544 | fi |
| 545 | if [ -n "$VCL_APP_PROXY_TRANSPORT_TCP" ] ; then |
| 546 | echo "export VCL_APP_PROXY_TRANSPORT_TCP=true" >> $1 |
| 547 | fi |
| 548 | if [ -n "$VCL_APP_PROXY_TRANSPORT_UDP" ] ; then |
| 549 | echo "export VCL_APP_PROXY_TRANSPORT_UDP=true" >> $1 |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 550 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 551 | if [ "$pre_cmd" = "$gdb_in_emacs " ] ; then |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 552 | if [ -n "$multi_host" ] && [[ $3 =~ "VPP".* ]] ; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 553 | cat <<EOF >> $1 |
| 554 | $gdb_in_emacs() { |
| 555 | sudo emacs --eval "(gdb \"gdb -x $2 -i=mi --args \$*\")" --eval "(setq frame-title-format \"$3\")" |
| 556 | } |
| 557 | EOF |
| 558 | else |
| 559 | cat <<EOF >> $1 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 560 | $gdb_in_emacs() { |
| 561 | emacs --eval "(gdb \"gdb -x $2 -i=mi --args \$*\")" --eval "(setq frame-title-format \"$3\")" |
| 562 | } |
| 563 | EOF |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 564 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 565 | fi |
| 566 | if [ -n "$4" ] ; then |
| 567 | echo "$4" >> $1 |
| 568 | fi |
| 569 | } |
| 570 | |
| 571 | write_script_footer() { |
| 572 | # arguments |
| 573 | # $1 : command script file |
| 574 | # $2 : perf flag indicating to run bash before exit |
| 575 | local -i perf=$2 |
| 576 | if [ $bash_after_exit -eq 1 ] || [ $perf -eq 1 ] ; then |
| 577 | echo "bash" >> $1 |
| 578 | fi |
| 579 | } |
| 580 | |
| 581 | write_gdb_cmdfile() { |
| 582 | # arguments |
| 583 | # $1 : gdb command file |
| 584 | # $2 : User specified gdb cmdfile |
| 585 | # $3 : emacs flag |
| 586 | # $4 : optional LD_PRELOAD library pathname. |
| 587 | local -i emacs=$3 |
| 588 | |
| 589 | echo "# $1 generated on $(date)" > $1 |
| 590 | echo "#" >> $1 |
| 591 | echo "set confirm off" >> $1 |
| 592 | if [ -n "$4" ] ; then |
| 593 | echo "set exec-wrapper env LD_PRELOAD=$4" >> $1 |
Dave Wallace | 5917939 | 2017-11-07 02:20:07 -0500 | [diff] [blame] | 594 | # echo "start" >> $1 |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 595 | fi |
| 596 | |
| 597 | if [ ! -f $2 ] ; then |
| 598 | echo -n "# " >> $1 |
| 599 | fi |
| 600 | echo "source $2" >> $1 |
| 601 | if [ $emacs -eq 0 ] ; then |
| 602 | echo "run" >> $1 |
| 603 | fi |
| 604 | } |
| 605 | |
| 606 | native_kernel() { |
| 607 | banner="Running NATIVE-KERNEL socket test" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 608 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 609 | title1="SERVER$title_dbg (Native-Kernel Socket Test)" |
| 610 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 611 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 612 | set_pre_cmd $emacs_server $gdb_server |
| 613 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
| 614 | echo "${pre_cmd}${app_dir}${srvr_app}" >> $cmd1_file |
| 615 | write_script_footer $cmd1_file $perf_server |
| 616 | chmod +x $cmd1_file |
| 617 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 618 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 619 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 620 | title2="CLIENT$title_dbg (Native-Kernel Socket Test)" |
| 621 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 622 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 623 | set_pre_cmd $emacs_client $gdb_client |
| 624 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "sleep 2" |
| 625 | echo "srvr_addr=\"$sock_srvr_addr\"" >> $cmd2_file |
| 626 | echo "${pre_cmd}${app_dir}${clnt_app}" >> $cmd2_file |
| 627 | write_script_footer $cmd2_file $perf_client |
| 628 | chmod +x $cmd2_file |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 629 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 630 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 631 | } |
| 632 | |
| 633 | native_preload() { |
| 634 | verify_no_vpp |
| 635 | banner="Running NATIVE-PRELOAD socket test" |
Dave Wallace | d69f4f4 | 2017-08-14 18:26:46 -0400 | [diff] [blame] | 636 | ld_preload="$VCL_LDPRELOAD_LIB_DIR/$vcl_ldpreload_lib " |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 637 | |
| 638 | title1="VPP$title_dbg (Native-Preload Socket Test)" |
| 639 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_vpp |
| 640 | gdb_cmdfile=$VPP_GDB_CMDFILE |
| 641 | set_pre_cmd $emacs_vpp $gdb_vpp |
| 642 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 643 | if [ -n "$multi_host" ] && [ $emacs_vpp -eq 0 ] ; then |
| 644 | echo -n "sudo " >> $cmd1_file |
| 645 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 646 | echo "${pre_cmd}$vpp_dir$vpp_app $vpp_args " >> $cmd1_file |
| 647 | write_script_footer $cmd1_file $perf_vpp |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 648 | chmod +x $cmd1_file |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 649 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 650 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 651 | title2="SERVER$title_dbg (Native-Preload Socket Test)" |
| 652 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 653 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 654 | set_pre_cmd $emacs_server $gdb_server $ld_preload |
| 655 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "sleep 2" |
| 656 | echo "export LD_LIBRARY_PATH=\"$lib64_dir:$VCL_LDPRELOAD_LIB_DIR:$LD_LIBRARY_PATH\"" >> $cmd2_file |
| 657 | echo "${pre_cmd}${app_dir}${srvr_app}" >> $cmd2_file |
| 658 | write_script_footer $cmd2_file $perf_server |
| 659 | chmod +x $cmd2_file |
| 660 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 661 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 662 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 663 | title3="CLIENT$title_dbg (Native-Preload Socket Test)" |
| 664 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 665 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 666 | set_pre_cmd $emacs_client $gdb_client $ld_preload |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 667 | write_script_header $cmd3_file $tmp_gdb_cmdfile "$title3" "sleep 4" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 668 | echo "export LD_LIBRARY_PATH=\"$lib64_dir:$VCL_LDPRELOAD_LIB_DIR:$LD_LIBRARY_PATH\"" >> $cmd3_file |
| 669 | echo "srvr_addr=\"$sock_srvr_addr\"" >> $cmd3_file |
| 670 | echo "${pre_cmd}${app_dir}${clnt_app}" >> $cmd3_file |
| 671 | write_script_footer $cmd3_file $perf_client |
| 672 | chmod +x $cmd3_file |
| 673 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 674 | } |
| 675 | |
| 676 | native_vcl() { |
| 677 | verify_no_vpp |
| 678 | banner="Running NATIVE-VCL socket test" |
| 679 | |
| 680 | title1="VPP$title_dbg (Native-VCL Socket Test)" |
| 681 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_vpp |
| 682 | gdb_cmdfile=$VPP_GDB_CMDFILE |
| 683 | set_pre_cmd $emacs_vpp $gdb_vpp |
| 684 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 685 | if [ -n "$multi_host" ] && [ $emacs_vpp -eq 0 ] ; then |
| 686 | echo -n "sudo " >> $cmd1_file |
| 687 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 688 | echo "${pre_cmd}$vpp_dir$vpp_app $vpp_args " >> $cmd1_file |
| 689 | write_script_footer $cmd1_file $perf_vpp |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 690 | chmod +x $cmd1_file |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 691 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 692 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 693 | title2="SERVER$title_dbg (Native-VCL Socket Test)" |
| 694 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 695 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 696 | set_pre_cmd $emacs_server $gdb_server |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 697 | if [ "$multi_host" = "server" ] ; then |
| 698 | delay="sleep 10" |
| 699 | else |
Dave Wallace | f7f809c | 2017-10-03 01:48:42 -0400 | [diff] [blame] | 700 | delay="sleep 2" |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 701 | fi |
| 702 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "$delay" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 703 | echo "export LD_LIBRARY_PATH=\"$lib64_dir:$LD_LIBRARY_PATH\"" >> $cmd2_file |
| 704 | echo "${pre_cmd}${app_dir}${srvr_app}" >> $cmd2_file |
| 705 | write_script_footer $cmd2_file $perf_server |
| 706 | chmod +x $cmd2_file |
| 707 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 708 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 709 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 710 | title3="CLIENT$title_dbg (Native-VCL Socket Test)" |
| 711 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 712 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 713 | set_pre_cmd $emacs_client $gdb_client |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 714 | if [ "$multi_host" = "client" ] ; then |
| 715 | delay="sleep 10" |
| 716 | else |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 717 | delay="sleep 4" |
Dave Wallace | 3d67449 | 2017-09-25 15:37:56 -0400 | [diff] [blame] | 718 | fi |
| 719 | write_script_header $cmd3_file $tmp_gdb_cmdfile "$title3" "$delay" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 720 | echo "export LD_LIBRARY_PATH=\"$lib64_dir:$LD_LIBRARY_PATH\"" >> $cmd3_file |
| 721 | echo "srvr_addr=\"$sock_srvr_addr\"" >> $cmd3_file |
| 722 | echo "${pre_cmd}${app_dir}${clnt_app}" >> $cmd3_file |
| 723 | write_script_footer $cmd3_file $perf_client |
| 724 | chmod +x $cmd3_file |
| 725 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 726 | } |
| 727 | |
| 728 | docker_kernel() { |
| 729 | verify_no_docker_containers |
| 730 | banner="Running DOCKER-KERNEL socket test" |
| 731 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 732 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 733 | title1="SERVER$title_dbg (Docker-Native Socket Test)" |
| 734 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 735 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 736 | set_pre_cmd $emacs_server $gdb_server |
| 737 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
| 738 | echo "docker run -it --cpuset-cpus='4-7' --cpuset-cpus='4-7' -v $vpp_dir:$docker_vpp_dir -p $sock_srvr_port:$sock_srvr_port $docker_os ${docker_app_dir}${srvr_app}" >> $cmd1_file |
| 739 | write_script_footer $cmd1_file $perf_server |
| 740 | chmod +x $cmd1_file |
| 741 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 742 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 743 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 744 | title2="CLIENT$title_dbg (Docker-Native Socket Test)" |
| 745 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 746 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 747 | set_pre_cmd $emacs_client $gdb_client |
| 748 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "sleep 2" |
| 749 | echo "$get_docker_server_ip4addr" >> $cmd2_file |
| 750 | echo "docker run -it --cpuset-cpus='4-7' -v $vpp_dir:$docker_vpp_dir $docker_os ${docker_app_dir}${clnt_app}" >> $cmd2_file |
| 751 | write_script_footer $cmd2_file $perf_client |
| 752 | chmod +x $cmd2_file |
| 753 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 754 | } |
| 755 | |
| 756 | docker_preload() { |
| 757 | verify_no_vpp |
| 758 | verify_no_docker_containers |
| 759 | banner="Running DOCKER-PRELOAD socket test" |
Dave Wallace | 30fb4a2 | 2017-08-17 16:22:04 -0400 | [diff] [blame] | 760 | docker_ld_preload_dir="/vcl-ldpreload/" |
| 761 | ld_preload_dir="$VCL_LDPRELOAD_LIB_DIR" |
| 762 | ld_preload="$docker_ld_preload_dir$vcl_ldpreload_lib " |
| 763 | docker_ld_preload_lib="$docker_ld_preload_dir$vcl_ldpreload_lib " |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 764 | |
| 765 | title1="VPP$title_dbg (Docker-Preload Socket Test)" |
| 766 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_vpp |
| 767 | gdb_cmdfile=$VPP_GDB_CMDFILE |
| 768 | set_pre_cmd $emacs_vpp $gdb_vpp |
| 769 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 770 | if [ -n "$multi_host" ] ; then |
| 771 | echo -n "sudo " >> $cmd1_file |
| 772 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 773 | echo "${pre_cmd}$vpp_dir$vpp_app $vpp_args" >> $cmd1_file |
| 774 | write_script_footer $cmd1_file $perf_vpp |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 775 | chmod +x $cmd1_file |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 776 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 777 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 778 | title2="SERVER$title_dbg (Docker-Preload Socket Test)" |
| 779 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 780 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 781 | set_pre_cmd $emacs_server $gdb_server $docker_ld_preload_lib |
| 782 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "sleep 2" |
Dave Wallace | ee45d41 | 2017-11-24 21:44:06 -0500 | [diff] [blame] | 783 | echo "docker run -it -v $vpp_shm_dir:$vpp_shm_dir -v $vpp_dir:$docker_vpp_dir -v $lib64_dir:$docker_lib64_dir -v $ld_preload_dir:$docker_ld_preload_dir -v $vcl_config_dir:$docker_vcl_config_dir -p $sock_srvr_port:$sock_srvr_port -e VCL_DEBUG=$VCL_DEBUG -e VCL_CONFIG=${docker_vcl_config_dir}$vcl_config -e LD_LIBRARY_PATH=$docker_lib64_dir:$docker_ld_preload_dir ${docker_ld_preload}$docker_os ${docker_app_dir}${srvr_app}" >> $cmd2_file |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 784 | write_script_footer $cmd2_file $perf_server |
| 785 | chmod +x $cmd2_file |
| 786 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 787 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 788 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 789 | title3="CLIENT$title_dbg (Docker-Preload Socket Test)" |
| 790 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 791 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 792 | set_pre_cmd $emacs_client $gdb_client $docker_ld_preload_lib |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 793 | write_script_header $cmd3_file $tmp_gdb_cmdfile "$title3" "sleep 4" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 794 | echo "$get_docker_server_ip4addr" >> $cmd3_file |
Dave Wallace | ee45d41 | 2017-11-24 21:44:06 -0500 | [diff] [blame] | 795 | echo "docker run -it --cpuset-cpus='4-7' -v $vpp_shm_dir:$vpp_shm_dir -v $vpp_dir:$docker_vpp_dir -v $lib64_dir:$docker_lib64_dir -v $ld_preload_dir:$docker_ld_preload_dir -v $vcl_config_dir:$docker_vcl_config_dir -e VCL_DEBUG=$VCL_DEBUG -e VCL_CONFIG=${docker_vcl_config_dir}$vcl_config -e LD_LIBRARY_PATH=$docker_lib64_dir ${docker_ld_preload}$docker_os ${docker_app_dir}${clnt_app}" >> $cmd3_file |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 796 | write_script_footer $cmd3_file $perf_client |
| 797 | chmod +x $cmd3_file |
| 798 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 799 | } |
| 800 | |
| 801 | docker_vcl() { |
| 802 | verify_no_vpp |
| 803 | verify_no_docker_containers |
| 804 | banner="Running DOCKER-VCL socket test" |
| 805 | |
| 806 | title1="VPP$title_dbg (Docker-VCL Socket Test)" |
| 807 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_vpp |
| 808 | gdb_cmdfile=$VPP_GDB_CMDFILE |
| 809 | set_pre_cmd $emacs_vpp $gdb_vpp |
| 810 | write_script_header $cmd1_file $tmp_gdb_cmdfile "$title1" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 811 | if [ -n "$multi_host" ] ; then |
| 812 | echo -n "sudo " >> $cmd1_file |
| 813 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 814 | echo "${pre_cmd}$vpp_dir$vpp_app $vpp_args" >> $cmd1_file |
| 815 | write_script_footer $cmd1_file $perf_vpp |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 816 | chmod +x $cmd1_file |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 817 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 818 | if [ -z "$multi_host" ] || [ "$multi_host" = "server" ] ; then |
| 819 | title2="SERVER$title_dbg (Docker-VCL Socket Test)" |
| 820 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_server |
| 821 | gdb_cmdfile=$VPPCOM_SERVER_GDB_CMDFILE |
| 822 | set_pre_cmd $emacs_server $gdb_server |
| 823 | write_script_header $cmd2_file $tmp_gdb_cmdfile "$title2" "sleep 2" |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 824 | echo "docker run -it --cpuset-cpus='4-7' -v $vpp_shm_dir:$vpp_shm_dir -v $vpp_dir:$docker_vpp_dir -v $lib64_dir:$docker_lib64_dir -v $vcl_config_dir:$docker_vcl_config_dir -p $sock_srvr_port:$sock_srvr_port -e VCL_CONFIG=${docker_vcl_config_dir}/$vcl_config -e LD_LIBRARY_PATH=$docker_lib64_dir $docker_os ${docker_app_dir}${srvr_app}" >> $cmd2_file |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 825 | write_script_footer $cmd2_file $perf_server |
| 826 | chmod +x $cmd2_file |
| 827 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 828 | |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 829 | if [ -z "$multi_host" ] || [ "$multi_host" = "client" ] ; then |
| 830 | title3="CLIENT$title_dbg (Docker-VCL Socket Test)" |
| 831 | tmp_gdb_cmdfile=$tmp_gdb_cmdfile_client |
| 832 | gdb_cmdfile=$VPPCOM_CLIENT_GDB_CMDFILE |
| 833 | set_pre_cmd $emacs_client $gdb_client |
| 834 | write_script_header $cmd3_file $tmp_gdb_cmdfile "$title3" "sleep 3" |
| 835 | echo "$get_docker_server_ip4addr" >> $cmd3_file |
Dave Wallace | 8af2054 | 2017-10-26 03:29:30 -0400 | [diff] [blame] | 836 | echo "docker run -it --cpuset-cpus='4-7' -v $vpp_shm_dir:$vpp_shm_dir -v $vpp_dir:$docker_vpp_dir -v $lib64_dir:$docker_lib64_dir -v $vcl_config_dir:$docker_vcl_config_dir -e VCL_CONFIG=${docker_vcl_config_dir}/$vcl_config -e LD_LIBRARY_PATH=$docker_lib64_dir $docker_os ${docker_app_dir}${clnt_app}" >> $cmd3_file |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 837 | write_script_footer $cmd3_file $perf_client |
| 838 | chmod +x $cmd3_file |
| 839 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 840 | } |
| 841 | |
| 842 | if [[ $run_test ]] ; then |
| 843 | eval $run_test |
| 844 | else |
| 845 | echo "ERROR: Please specify a test to run!" >&2 |
| 846 | usage; |
| 847 | fi |
| 848 | |
| 849 | if (( $(which xfce4-terminal | wc -l) > 0 )) ; then |
| 850 | xterm_cmd="xfce4-terminal --geometry $xterm_geom" |
| 851 | if [[ $use_tabs ]] ; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 852 | declare -a tab_cmd_files |
| 853 | declare -a tab_titles |
| 854 | declare -i i=0 |
| 855 | |
| 856 | if [ -x "$cmd1_file" ] ; then |
| 857 | tab_cmd_files[$i]="$cmd1_file" |
| 858 | tab_titles[$i]="$title1" |
| 859 | (( i++ )) |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 860 | fi |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 861 | if [ -x "$cmd2_file" ] ; then |
| 862 | tab_cmd_files[$i]="$cmd2_file" |
| 863 | tab_titles[$i]="$title2" |
| 864 | (( i++ )) |
| 865 | fi |
| 866 | if [ -x "$cmd3_file" ] ; then |
| 867 | tab_cmd_files[$i]="$cmd3_file" |
| 868 | tab_titles[$i]="$title3" |
| 869 | fi |
| 870 | |
| 871 | if [ -n "${tab_cmd_files[2]}" ] ; then |
| 872 | $xterm_cmd --title "${tab_titles[0]}" --command "${tab_cmd_files[0]}" --tab --title "${tab_titles[1]}" --command "${tab_cmd_files[1]}" --tab --title "${tab_titles[2]}" --command "${tab_cmd_files[2]}" |
| 873 | elif [ -n "${tab_cmd_files[1]}" ] ; then |
| 874 | $xterm_cmd --title "${tab_titles[0]}" --command "${tab_cmd_files[0]}" --tab --title "${tab_titles[1]}" --command "${tab_cmd_files[1]}" |
| 875 | |
| 876 | else |
| 877 | $xterm_cmd --title "${tab_titles[0]}" --command "${tab_cmd_files[0]}" |
| 878 | fi |
| 879 | |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 880 | else |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 881 | if [ -x "$cmd1_file" ] ; then |
| 882 | ($xterm_cmd --title "$title1" --command "$cmd1_file" &) |
| 883 | fi |
| 884 | if [ -x "$cmd2_file" ] ; then |
| 885 | ($xterm_cmd --title "$title2" --command "$cmd2_file" &) |
| 886 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 887 | if [ -x "$cmd3_file" ] ; then |
| 888 | ($xterm_cmd --title "$title3" --command "$cmd3_file" &) |
| 889 | fi |
| 890 | fi |
| 891 | |
| 892 | else |
| 893 | if [[ $use_tabs ]] ; then |
| 894 | echo "Sorry, plain ol' xterm doesn't support tabs." |
| 895 | fi |
| 896 | xterm_cmd="xterm -fs 10 -geometry $xterm_geom" |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 897 | if [ -x "$cmd1_file" ] ; then |
| 898 | ($xterm_cmd -title "$title1" -e "$cmd1_file" &) |
| 899 | fi |
| 900 | if [ -x "$cmd2_file" ] ; then |
| 901 | ($xterm_cmd -title "$title2" -e "$cmd2_file" &) |
| 902 | fi |
Dave Wallace | 543852a | 2017-08-03 02:11:34 -0400 | [diff] [blame] | 903 | if [ -x "$cmd3_file" ] ; then |
| 904 | ($xterm_cmd -title "$title3" -e "$cmd3_file" &) |
| 905 | fi |
| 906 | fi |
| 907 | |
| 908 | sleep 1 |