LTP installed, executed, cleaned on target node
[validation.git] / tests / os / ltp / ltp.robot
1 ##############################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property.                             #
3 # Copyright (c) 2019 Nokia.                                                  #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License");            #
6 # you maynot use this file except in compliance with the License.            #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17
18 *** Settings ***
19 Documentation     Validation, robustness and stability of Linux
20 Library           SSHLibrary
21 Library           OperatingSystem
22 Library           BuiltIn
23 Library           Process
24 Suite Setup       Run Keywords
25 ...               Open Connection And Log In
26 ...               Install LTP
27 Test Teardown     Download Logs
28 Suite Teardown    Run Keywords
29 ...               Uninstall LTP
30 ...               Close All Connections
31
32 *** Variables ***
33 ${FULL_SUITE}            ${SUITE_NAME.replace(' ','_')}
34
35 *** Test Cases ***
36 # Plese maintain shortest job first order
37 RunLTP syscalls madvise only
38     [Documentation]         Wait ~1m for madvise01-10 to complete
39     ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
40     ${result}=              Execute Command  /opt/ltp/runltp -f syscalls -s madvise  sudo=True
41     Append To File          ${log}  ${result}${\n}
42     Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
43
44 RunLTP syscalls only
45     [Documentation]         Wait ~45m for syscalls to complete
46     ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_').log
47     ${result}=              Execute Command  /opt/ltp/runltp -f syscalls  sudo=True
48     Append To File          ${log}  ${result}${\n}
49     Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
50
51 RunLTP all tests
52     [Documentation]         Wait ~5hrs to complete 2536 tests
53     ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_').log
54     ${result}=              Execute Command  /opt/ltp/runltp  sudo=True
55     Append To File          ${log}  ${result}${\n}
56     Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
57
58 *** Keywords ***
59 Open Connection And Log In
60     Open Connection        ${HOST}
61     Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}
62
63 Install LTP
64     Put File  /opt/akraino/ltp.tar.gz  /tmp/ltp.tar.gz
65     Execute Command  tar -xf /tmp/ltp.tar.gz -C /
66
67 Uninstall LTP
68     Execute Command  rm -rf /opt/ltp  sudo=True
69     Execute Command  rm /tmp/ltp.tar.gz
70
71 Download Logs
72     SSHLibrary.Get File  /opt/ltp/output/*  ${OUTPUT DIR}/output/
73     Execute Command  rm -rf /opt/ltp/output/*  sudo=True
74     SSHLibrary.Get File  /opt/ltp/results/*  ${OUTPUT DIR}/results/
75     Execute Command  rm -rf /opt/ltp/results/*  sudo=True