[PATCH v4 00/29]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patches add tests/remote directory and functionality
to run remote tests with hostapd/wpa_supplicant using:
- wpaspy.py - (UDP) for communication with hostapd,
              wpa_supplicant CTRL interface
- hostapd.py - for control hostapd
- wpasupplicant.py - for control wpa_supplicant

This three files were modified (as minimal as possible)
to be used with remote hosts.

Also wpaspy.Host class was added. This is used for run
remote shell commands and base on ssh and authorized_keys
connection.
So, each machine you would like to use in your remote test
system should have configured authorized_keys correctly.
Eg. you should be able to simple execute

ssh root@<your_ip_or_host> id

In case of wpa_supplicant and hostapd configuration you can
simply use examples from tests/hwsim and add such option to
the .config file:

CONFIG_CTRL_IFACE=udp-remote

Added files:
- remote/run-tests.py - run tc script
- remote/utils.py
- remote/test_ap_open.py

This works similar to the hwsim version and will run all
test_* from test_* modules. As a parameters each test get
t(devices, duts, setup_params, ref, dut) where:
- devices - available device table
- setup_params - environtment setup params
- ref - reference device name should be used
- dut - dut name should be tested

Devices table is table of RemoteHost. This is simple dictionary
which contais:
- hostname - remote PC IPv4, hostname or IPv4
- ifname - wifi interface should be used
- port - CTRL UDP port should be used
- name - name
- flags - eg. AP_VHT80, STA_VHT80 ...

Each test case is responsible for run/terminate wpa_supplicant
or hostapd. Because of that I added termiate support to hostapd
and wpaspy.py.

As a example of test cases I added test_ap_open.py file which
tests most of AP open setups and run iperf/iperf3 (IPv4, IPv6, tcp,
udp) tests between STATION and AP. I verify this using:
- AP - Atheros ath10k
- STA - Intel 7260

So, steps you need before setup:
- compile hostapd/wpa_supplicant with CONFIG_CTRL_IFACE=udp-remote
  on your remote PCs/devices
- setup authorized_keys correctly
- fill devices table cfg.py
- fill setup_params in cfg.py

After that you can check devices:
./run-tests.py -t devices

After that you can simply run sanity:
./run-tests.py -d <dut_name> -t all|sanity

Log system (based on hwsim and using logger):
You can find logs in logs directory. logs/current point to
last tests run.
Each failed test case get (using scp) wpa_supplicant and
hostapd logs and put them in logs directory.

In the future I can add more test cases base on this "framework".
Please review.

Example:
janusz@dell6430:~/work/hostap/tests/remote$ ./run-tests.py -d t1-ath10k -r t2-intel7260 -t sanity
DUT: t1-ath10k
REF: t2-intel7260
START - AP with open mode (no security) configuration IPv4 ping (1/24)
PASS (packet_loss: 0%, 0%) - 14.863048s
START - AP with open mode (no security) configuration IPv6 (2/24)
PASS (packet_loss: 0%, 0%) - 17.864918s
START - STA with open mode (no security) configuration IPv4 ping (3/24)
PASS (packet_loss: 0%, 0%) - 11.987938s
START - STA with open mode (no security) configuration IPv6 (4/24)
PASS (packet_loss: 0%, 0%) - 15.000189s
START - AP with CCMP configuration IPv4 ping (5/24)
PASS (packet_loss: 0%, 0%) - 17.311671s
START - AP with CCMP configuration IPv6 (6/24)
PASS (packet_loss: 0%, 0%) - 17.340123s
START - STA with CCMP configuration IPv4 ping (7/24)
PASS (packet_loss: 0%, 0%) - 13.358742s
START - STA with CCMP configuration IPv6 (8/24)
PASS (packet_loss: 0%, 0%) - 16.397097s
START - AP with mixed TKIP/CCMP configuration IPv4 ping (9/24)
PASS (packet_loss: 0%, 0%) - 17.255922s
START - AP with mixed TKIP/CCMP configuration IPv6 (10/24)
PASS (packet_loss: 0%, 0%) - 17.399922s
START - STA with mixed TKIP/CCMP configuration IPv4 ping (11/24)
PASS (packet_loss: 0%, 0%) - 13.366837s
START - STA with mixed TKIP/CCMP configuration IPv6 (12/24)
PASS (packet_loss: 0%, 0%) - 13.368448s
START - AP with TKIP configuration IPv4 ping (13/24)
PASS (packet_loss: 0%, 0%) - 17.403868s
START - AP with TKIP configuration IPv6 (14/24)
PASS (packet_loss: 0%, 0%) - 17.310886s
START - STA with TKIP configuration IPv4 ping (15/24)
PASS (packet_loss: 0%, 0%) - 13.323619s
START - STA with TKIP configuration IPv6 (16/24)
PASS (packet_loss: 0%, 0%) - 13.314537s
START - AP with WEP configuration IPv4 ping (17/24)
PASS (packet_loss: 0%, 0%) - 14.916285s
START - AP with WEP configuration IPv6 (18/24)
PASS (packet_loss: 0%, 0%) - 17.890211s
START - STA with WEP configuration IPv4 ping (19/24)
PASS (packet_loss: 0%, 0%) - 11.959147s
START - STA with WEP configuration IPv6 (20/24)
PASS (packet_loss: 0%, 0%) - 14.999853s
START - AP with WEP shared configuration IPv4 ping (21/24)
PASS (packet_loss: 0%, 0%) - 14.884378s
START - AP with WEP shared configuration IPv6 (22/24)
PASS (packet_loss: 0%, 0%) - 17.910496s
START - STA with WEP shared configuration IPv4 ping (23/24)
PASS (packet_loss: 0%, 0%) - 11.976571s
START - STA with WEP shared configuration IPv6 (24/24)
PASS (packet_loss: 0%, 0%) - 14.972161s


Janusz Dziedzic (29):
  wpa_supplicant: ctrl udp allow to set port
  wpa_supplicant: change attach/detach/send ctrl UDP functions
  wpa_supplicant: add monitor support for global ctrl UDP iface
  wpa_supplicant: add common ctrl iface files
  wpa_supplicant: ctrl unix use common functions
  hostapd: ctrl unix use common ctrl code
  ctrl unix: use sockaddr_storage
  hostap: add UDP support for ctrl iface
  hostapd: ctrl udp allow to set port
  wpa_supplicant: udp ctrl setup ctrl_interface
  wpa_supplicant: udp ctrl show when ITERFACES ctrl cmd
  hostapd: setup real ctrl_interface for UDP
  hostapd: add INTERFACES ctrl command
  hostapd: add global TERMINATE command
  wpa_cli: handle IFNAME correctly for global iface
  wpaspy: add support for UDP connection
  wpaspy: add debug support for Ctrl UDP class
  tests: wpasupplicant.py allow to use remote host
  tests: hostapd.py allow to use remote host
  wpaspy: add Host class
  tests: hostapd.py/wpasupplicant.py use host when execute
  tests: hostapd.py add get_ctrl_iface_port
  wpaspy: add terminate support
  tests: add terminate support for hostapd/wpa_supplicant
  tests: hostapd.py add params for required configurations
  tests: Adde remote directory to tests
  tests: remote add utils
  tests/remote: Add TP tests for AP STA.
  tests/remote: add test_ap_sta_tp.sh script

 hostapd/Makefile                 |   24 +-
 hostapd/ctrl_iface.c             |  529 +++++++++++++------
 hostapd/hostapd_cli.c            |    5 +
 hostapd/main.c                   |    7 +-
 src/ap/hostapd.c                 |    1 +
 src/ap/hostapd.h                 |    4 +-
 src/common/ctrl_iface_common.c   |  141 ++++++
 src/common/ctrl_iface_common.h   |   36 ++
 src/common/wpa_ctrl.c            |    2 +
 tests/hwsim/hostapd.py           |  138 ++++-
 tests/hwsim/wpasupplicant.py     |   82 ++-
 tests/remote/config.py           |   81 +++
 tests/remote/run-tests.py        |  223 ++++++++
 tests/remote/test_ap_sta_tp.py   | 1034 ++++++++++++++++++++++++++++++++++++++
 tests/remote/test_ap_sta_tp.sh   |   42 ++
 tests/remote/utils.py            |  340 +++++++++++++
 wpa_supplicant/Makefile          |    1 +
 wpa_supplicant/ctrl_iface.c      |   21 +-
 wpa_supplicant/ctrl_iface_udp.c  |  146 ++++--
 wpa_supplicant/ctrl_iface_unix.c |   96 +---
 wpaspy/test.py                   |   23 +-
 wpaspy/wpaspy.py                 |  163 +++++-
 22 files changed, 2811 insertions(+), 328 deletions(-)
 create mode 100644 src/common/ctrl_iface_common.c
 create mode 100644 src/common/ctrl_iface_common.h
 create mode 100644 tests/remote/config.py
 create mode 100755 tests/remote/run-tests.py
 create mode 100755 tests/remote/test_ap_sta_tp.py
 create mode 100755 tests/remote/test_ap_sta_tp.sh
 create mode 100644 tests/remote/utils.py

-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux