############################################################################## # # AUTHORS: Gianni Pucciani, CERN # CREATED: 8 December 2008 # ############################################################################## The following scripts are meant to be used during the certification of the first SCAS patch to run stress tests. Files ----- setup_test.exp This Expect script is used to automatically login on several machines and call a script to setup the test on each machine. The usage is the following: expect setup_test.exp The passwords file is a text file with the list of machines with the associated root password separated by a colon ':'. The first line is the user AFS login/pass. E.g. ---------------------------------- afs_user:afs_pass machine1:pass1 machine2:pass2 ... machinen:passn ---------------------------------- No comments can be included in this file. The node setup script is a script that will be copied under /root of the target machine and executed. This script is supposed to prepare the environment for the test on the target machine. If the execution of the setup node is successful (i.e the node setup script returns '0'), an empty file with the name of the target machine will be created under the location specified by the last argument, the log file location. It is important to remind that the node setup script must be available on an AFS space where it can be retrieved. The log file location must also be on an AFS space. KNOWN ISSUES From time to time to time the script signal an error in the log file creation step, or it does not signal errors but the file does not show up. This problem appears randomly and it is usually solved calling the script after a short pause of 10-30 seconds. In case an automatic ssh login can be done with the ssh-agent, the next script must be used. - setup_test.sh - This script will be used in place of the previous expect script. In order to run the script, you first have to launch the ssh-agent: #eval `ssh-agent` #ssh-add /home//.ssh/id_rsa #ssh-add -l Usage: ./setup_test.sh The script is called without arguments, the machine names used to launch glexec requests are hardcoded. The script setup_test.cfg is sourced to export some variables used by this script. The script creates a log file in the location specified in the configuration file, and for each defined machine the script logs into it and: - get an AFS token with a script stored in $get_afstoken_script (from the cfg file) - touch a log file with the name of the machine in $log_location (from the cfg file) - call the setup node script (explained later) stored in $setup_node_script (from the cfg file) passing as arguments the log file name just created plus an index used to discriminate the node. - setup_test.cfg - Configuration file for the previous script. It exports the following variables: setup_node_script log_location get_afstoken_script pass_file afs_pass_file afs_user - setup_node.sh - Usage: ./setup_node.sh integer number to identify the node. the file that will be used to log data and start the test. This script is called by the previous one. It is used to setup a node on which the test will run and call the real test script (glexec_stress_test.sh, hardcoded). The operations that are done before calling the test script are: *get test_user_ cert/key and create a proxy *run a daemon to renew the proxy *retrieve the glexec test *launch the glexec test - glexec_stress_test.sh - Usage: ./glexec_stress_test.sh -f {-n |-d } -i an integer number to state the number of tests to be done. a date until when to execute the test. The format must be YYYYMMDDhhmm (returned by date +%Y%m%d%H%M). E.g. 20 January 2009 at 8am => 200901200800 an integer number to identify the node This script is called by the previous one. It is the one used on the WN to launch a certain amount of glexec commands. In particular, the script will execute the glexec test either n times or until a specified date. The starting of test is triggered when the word 'START' is found in the specified log file. The log file will be also used to collect time information about the request. The index passed with the -i option is used to distinguish node and test user. The data file named _data will be created in the same directory as the and will be used to store pairs (timestamp , response time of glexec call). In the the output of the glexec call is stored. - verify_glexec_output.sh - Usage: ./verify_glexec_output.sh Unix user that should be returned by the glexec test In case of pool accounts one can specify the prefix (without numbers). The file containing the output of the glexec test This script is used to verify the output produced by the glexec_stress_test file, which should contain just the word 'START' (inserted by the user to trigger the start of the stress test) and the mapped user returned by the command: $GLITE_LOCATION/sbin/glexec "/usr/bin/whoami". Since the script look uses the regular expression [^$user], in case of pool accounts one can just specify the prefix (E.g 'pildtm' can be specified to verify accounts like 'pildtm01', 'pildtm10' etc..) The file to be provided as second argument is the one created by the script setup_test.sh, and it is named as the host that will write on that file.