7069e5e608662c47fd390752de50bf91d0a904f5
[csit.git] / resources / libraries / bash / dut_setup.sh
1 #!/bin/bash
2 # Copyright (c) 2016 Cisco and/or its affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 function cmd {
16     echo
17     echo "[Command_start_exec] '$1'"
18     echo -n "[Command_outputs] "
19     eval ${@}
20     echo "[Command_done_exec] '$1'"
21     echo
22 }
23
24 echo
25 echo "[Command_desc] Starting ${0}"
26
27 cmd 'dpkg -l vpp\*'
28
29 cmd 'ps aux | grep vpp'
30
31 cmd 'cat /etc/vpp/startup.conf'
32
33 cmd 'sudo -S service vpp restart'
34
35 echo "[Command_desc] SLEEP for three seconds, so that VPP is up for sure"
36 cmd 'sleep 3'
37
38 cmd 'cat /proc/meminfo'
39
40 cmd 'free -m'
41
42 cmd 'ps aux | grep vpp'
43
44 cmd 'sudo dmidecode | grep UUID'
45
46 cmd 'lspci -Dnn'
47
48 cmd 'tail -n 50 /var/log/syslog'
49
50 echo "[Command_desc] Adding dpdk-input trace"
51 cmd 'sudo vpp_api_test <<< "exec trace add dpdk-input 100"'
52