• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# LTP Network Tests
2
3## Single Host Configuration
4
5It's the default configuration (if the `RHOST` environment variable is not
6defined). LTP adds `ltp_ns` network namespace and auto-configure `veth` pair
7according to LTP network environment variables.
8
9## Two Host Configuration
10
11This setup requires the `RHOST` environment variable to be set properly and
12configured SSH access to a remote host.
13
14The `RHOST` variable must be set to the hostname of the server (test management
15link) and public key setup or login without password is required.
16
17SSH server needs to be configured to allow root login and use Public Key
18Authentication (`PermitRootLogin yes` and `PubkeyAuthentication yes` in
19`/etc/ssh/sshd_config`).
20
21Some of the network stress tests which hasn't been ported to network API were
22designed to be tested with `rsh` via `LTP_RSH` environment variable. Now it's
23by default used `ssh`, for details see `testcases/network/stress/README`.
24
25## Server Services Configuration
26Tests have various external dependencies, exit with `TCONF` when not installed.
27Some tests require additional setup.
28
29### FTP and telnet setup
30FTP stress tests and telnet server tests require environment variables `RHOST`
31(remote machine), `RUSER` (remote user) and `PASSWD` (remote password). NOTE:
32`RHOST` will imply two host configuration for other tests.
33
34If `RUSER` is set to `root`, either of these steps is required:
35
36* In `/etc/ftpusers` (or `/etc/vsftpd.ftpusers`), comment the line containing
37"root" string. This file lists all those users who are not given access to do ftp
38on the current system.
39
40* If you don’t want to do the previous step, put following entry into `/root/.netrc`:
41```
42machine <remote_server_name>
43login root
44password <remote_root_password>
45```
46
47### HTTP setup
48HTTP stress tests require configured and running web server (Apache2, Nginx, etc.).
49
50### NFS setup
51NFS tests require running NFS server, enable and start `nfs-server.service`
52(Debian/Ubuntu and openSUSE/SLES: `nfs-kernel-server` package, others:
53`nfs-server` package).
54
55There is no detection whether service is running, test will simply fail without
56warning.
57
58### TI-RPC / Sun RPC setup
59TI-RPC (or glibc legacy Sun RPC) tests require running rpcbind (or portmap on
60old distributions), enable and start `rpcbind.service`.
61
62## LTP setup
63Install LTP testsuite (see INSTALL). In case of two hosts configuration, LTP
64needs to be installed the same exact location and `LTPROOT` and `PATH`
65environment variables set on *both* client and server machines. This is
66required because some tests expect to find server files in certain locations.
67
68Example for the default prefix `/opt/ltp`:
69
70```sh
71export LTPROOT="/opt/ltp"; export PATH="$LTPROOT/testcases/bin:$PATH"
72```
73
74## Running the tests
75The network tests are executed by running the network.sh script:
76
77```sh
78TEST_VARS ./network.sh OPTIONS
79```
80Where
81* `TEST_VARS` - non-default network parameters
82* `OPTIONS` - test group(s), use `-h` to see available ones.
83
84Default values for all LTP network parameters are set in `testcases/lib/tst_net.sh`.
85Network stress parameters are documented in `testcases/network/stress/README`.
86
87## Debugging
88Both single and two host configurations support debugging via
89`TST_NET_RHOST_RUN_DEBUG=1` environment variable.
90