| #!/bin/sh |
| # - group |
| |
| ## Automated hostapd/wpa_supplicant testing with mac80211_hwsim. |
| ## See: https://github.com/jmalinen/hostap/tree/master/tests/hwsim |
| |
| cd $BENCHMARK_ROOT/hwsim/tests/hwsim || exit |
| |
| . $LKP_SRC/lib/debug.sh |
| . $LKP_SRC/lib/reproduce-log.sh |
| |
| group_file=$LKP_SRC/pack/hwsim-addon/groups/$group |
| [ -f "$group_file" ] || { |
| group_file=$BENCHMARK_ROOT/hwsim/$group |
| [ -f "$group_file" ] || die "can not find group_file both in $LKP_SRC/pack/hwsim-addon/groups and $BENCHMARK_ROOT/hwsim" |
| } |
| |
| nm_conf="/etc/NetworkManager/NetworkManager.conf" |
| [ -f "$nm_conf" ] && log_eval "cat >> $nm_conf <<EOF |
| [keyfile] |
| unmanaged-devices=mac:02:00:00:00:00:00;mac:02:00:00:00:01:00;mac:02:00:00:00:02:00;mac:02:00:00:00:03:00;mac:02:00:00:00:04:00 |
| EOF" |
| |
| [ $USER ] || log_eval export USER=root |
| |
| require_mcc=$BENCHMARK_ROOT/hwsim/tests/hwsim/require_mcc |
| |
| add_extra_options() |
| { |
| opt= |
| [ -f $BENCHMARK_ROOT/hwsim/tests/hwsim/require_long_param ] && |
| grep -q -w $casename $BENCHMARK_ROOT/hwsim/tests/hwsim/require_long_param && opt="--long" |
| } |
| |
| check_ignore_case() |
| { |
| local casename=$1 |
| local ignored_by_lkp=$BENCHMARK_ROOT/hwsim/tests/hwsim/ignored_by_lkp |
| |
| # skip cases that in ignored_by_lkp |
| [ -f "$ignored_by_lkp" ] && grep -q -w $casename "$ignored_by_lkp" && return 0 |
| |
| return 1 |
| } |
| |
| log_cmd ./build.sh 2>&1 || die "fail to build test environment" |
| |
| log_cmd ./start.sh || die "fail to setup test environment" |
| |
| while read casename |
| do |
| check_ignore_case $casename && echo "ignored_by_lkp $casename" && continue |
| |
| [ -f $require_mcc ] && |
| grep -q -w $casename $require_mcc && continue |
| |
| add_extra_options |
| log_echo "\ |
| ./run-tests.py $casename $opt" |
| ./run-tests.py $casename $opt 2>&1 |
| done < $group_file |
| log_cmd ./stop.sh |
| |
| # test with multi-channels |
| [ -f $require_mcc ] || exit 0 |
| log_cmd ./start.sh channels=4 || die "fail to setup mcc test environment" |
| |
| grep -wf $group_file $require_mcc | while read casename |
| do |
| check_ignore_case $casename && continue |
| |
| add_extra_options |
| log_echo "\ |
| ./run-tests.py $casename $opt" |
| ./run-tests.py $casename $opt 2>&1 |
| done |
| log_cmd ./stop.sh |