1 # LTP Network Tests 2 3 ## Pre-requisites 4 Enable all the networking services on test machine(s): rshd, nfsd, fingerd. 5 6 ## Single Host Configuration 7 8 It is a default configuration ('RHOST' is not defined). LTP adds 'ltp_ns' 9 network namespace and auto-configure 'veth' pair according to LTP network 10 environment variables. 11 12 ## Two Host Configuration 13 14 This setup requires 'RHOST' environment variable to be set properly and 15 configured SSH or RSH (default) access to a remote host. 16 17 The 'RHOST' variable name must be set to the hostname of the server 18 (test management link) and PASSWD should be set to the root password 19 of the remote server. 20 21 In order to have RSH access: 22 * Edit the "/root/.rhosts" file. Please note that the file may not exist, 23 so you must create one if it does not. You must add the fully qualified 24 hostname of the machine you are testing on to this file. By adding the test 25 machine's hostname to this file, you will be allowing the machine to rsh to itself, 26 as root, without the requirement of a password. 27 28 ```sh 29 echo $client_hostname >> /root/.rhosts 30 ``` 31 32 You may need to re-label '.rhost' file to make sure rlogind will have access to it: 33 34 ```sh 35 /sbin/restorecon -v /root/.rhosts 36 ``` 37 38 * Add rlogin, rsh, rexec into /etc/securetty file: 39 40 ```sh 41 for i in rlogin rsh rexec; do echo $i >> /etc/securetty; done 42 ``` 43 44 ## Server Services Configuration 45 Verify that the below daemon services are running. If not, please install 46 and start them: 47 rsh-server, telnet-server, finger-server, rdist, rsync, dhcp-server, http-server. 48 49 Note: If any of the above daemon is not running on server, the test related to 50 that service running from client will fail. 51 52 ### FTP setup 53 * In /etc/ftpusers [or vi /etc/vsftpd.ftpusers], comment the line containing 54 root string. This file lists all those users who are not given access to do ftp 55 on the current system. 56 57 * If you dont want to do the previous step, put following entry into /root/.netrc 58 machine <remote_server_name> login root password <remote_root_password>. 59 Otherwise, ftp,rlogin & telnet fails for root user & hence needs to be 60 executed using test user to get successful results. 61 62 ## LTP setup 63 Install LTP testsuite. In case of two hosts configuration, make sure LTP is installed 64 on both client and server machines. 65 66 Testcases and network tools must be in PATH, e.g.: 67 68 ```sh 69 export PATH=/opt/ltp/testcases/bin:/usr/bin:$PATH 70 ``` 71 Default values for all LTP network variables are set in testcases/lib/test_net.sh. 72 If you need to override some parameters please export them before test run or 73 specify them when running ltp-pan or testscripts/network.sh. 74 75 ## Running the tests 76 To run the test type the following: 77 78 ```sh 79 TEST_VARS ./network.sh OPTIONS 80 ``` 81 Where 82 * TEST_VARS - non-default network parameters (see testcases/lib/test_net.sh), they 83 could be exported before test run; 84 * OPTIONS - test group(s), use '-h' to see available ones. 85 86 ## Analyzing the results 87 Generally this test must be run more than 24 hours. When you want to stop the test 88 press CTRL+C to stop ./network.sh. 89 90 Search failed tests in LTP logfile using grep FAIL <logfile>. For any failures, 91 run the individual tests and then try to come to the conclusion. 92