Network automatic Script for testing

This is the automatic script which i will be using on debug or reproduce issue like stability test for Network.

Shell Script

This script will be added inside console, keep running and logged log.

syntax of bashscript:

1
2
3
4
5
6
7
8
#!/bin/sh
while true
do
echo "Polling EthPhy Status !"


sleep 1 ;
done

Read top evey 60 second and logf file

1
2
3
4
5
6
while true; do
date
free
top -b -n1 | head -15
sleep 60
done >> /tmp/memlog.txt

check bbu status every 10 second

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
htx_pcd_app -a start -r BATTERY_HOST
while [ 1 ];
do
date
echo "####################"
battery_host -m 1 -s
echo "###################"
echo ""
echo "================"
uci show bbu -c /var/tmp
echo "================"
sleep 10
echo ""
echo ""
done

TTL Macro Script

This is use when connect DUT to console, it will run command and record the log

Run stability and run some system command

In this script will run this command below to check is there any memory leak or high cpu. The purpose of this test is to verify Ipv6 drop, and acs will also not get ipv6 global after IP drop

  • get acs ipv6 parameter: tr69_trigger getvalues Device.PPP.Interface.1.IPv6CP
  • ip address: ifconfig
  • get free memory: free -m
  • ps: ps
  • top: top -b -n1 | head -15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
:START
;sendln 'date'
pause 2
sendln ''
sendln 'echo "-----------------------------------"'
;sendln 'ifconfig'
pause 10
sendln ''
sendln ''
sendln ''
sendln ' tr69_trigger getvalues Device.PPP.Interface.1.IPv6CP'
pause 60


;sendln 'echo "System Memory (free -m)"'
;sendln 'free -m'
;pause 5
;sendln ''
;sendln ''



;sendln 'echo "ps"'
;sendln 'ps'
;pause 30
;sendln ''
;sendln ''

;sendln 'echo "top"'
;sendln 'top -b -n1 | head -15'
;pause 60
sendln 'echo "-----------------------------------"'
sendln ''
sendln ''
goto START

Other scipt on system

shell script: acs server clean log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#chenchih 04/01/2021
#!/bin/bash
#3touch hhhhh.txt
#read -p "Please enter your log bane:" filename
echo "storage space"
df -h
locationlog="/opt/jboss/server/default/log"
cd $locationlog
ls
echo -n "Please enter your log name you want to delete:(ex:2021-03-01): "
read filename
rm -f server.log.$filename*
echo "===================deleted================"
ls