From 8acab9fd267fbc5067495b63c5c142cb8b265670 Mon Sep 17 00:00:00 2001 From: Naga Sugguna Date: Wed, 9 Oct 2019 21:16:34 +0000 Subject: [PATCH] LTP installed, executed, cleaned on target node Jira: [VAL-66] LTP testcase fixed to run on cluster master node. LTP prebuilt binary is installed and cleaned. LTP output and results downloaded for every testcase Change-Id: Id3b96f97418034b6099fb11a472a285889159cc4 Signed-off-by: Naga Sugguna --- tests/os/ltp/ltp.robot | 69 +++++++++++++++++++++++++---------------- tests/os/ltp/variables.resource | 23 -------------- 2 files changed, 43 insertions(+), 49 deletions(-) delete mode 100644 tests/os/ltp/variables.resource diff --git a/tests/os/ltp/ltp.robot b/tests/os/ltp/ltp.robot index 8418bc8..4ec8b45 100644 --- a/tests/os/ltp/ltp.robot +++ b/tests/os/ltp/ltp.robot @@ -21,38 +21,55 @@ Library SSHLibrary Library OperatingSystem Library BuiltIn Library Process -Resource variables.resource -Suite Setup Open Connection And Log In -Suite Teardown Close All Connections +Suite Setup Run Keywords +... Open Connection And Log In +... Install LTP +Test Teardown Download Logs +Suite Teardown Run Keywords +... Uninstall LTP +... Close All Connections *** Variables *** -${LOG} ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log - +${FULL_SUITE} ${SUITE_NAME.replace(' ','_')} *** Test Cases *** -#Run whole ltp test suite -# [Documentation] Wait ~5hrs to complete 2536 tests -# ${result}= Run Process ./runltp shell=yes cwd=/opt/ltp stdout=${LOG} -# Append To File ${LOG} ${result}${\n} -# Sleep 2s -# Should Contain ${result.stdout} failed 0 - -#Run ltp syscalls test suite -# [Documentation] Wait ~45m for syscalls to complete -# ${result}= Run Process ./runltp -f syscalls shell=yes cwd=/opt/ltp stdout=${LOG} -# Append To File ${LOG} ${result}${\n} -# Sleep 2s -# Should Contain ${result.stdout} failed 0 - -Run ltp syscalls madvise +# Plese maintain shortest job first order +RunLTP syscalls madvise only [Documentation] Wait ~1m for madvise01-10 to complete - ${result}= Run Process ./runltp -f syscalls -s madvise shell=yes cwd=/opt/ltp stdout=${LOG} - Append To File ${LOG} ${result}${\n} - Sleep 2s - Should Contain ${result.stdout} failed 0 + ${log} = Set Variable ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log + ${result}= Execute Command /opt/ltp/runltp -f syscalls -s madvise sudo=True + Append To File ${log} ${result}${\n} + Should Contain ${result} INFO: ltp-pan reported all tests PASS + +RunLTP syscalls only + [Documentation] Wait ~45m for syscalls to complete + ${log} = Set Variable ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_').log + ${result}= Execute Command /opt/ltp/runltp -f syscalls sudo=True + Append To File ${log} ${result}${\n} + Should Contain ${result} INFO: ltp-pan reported all tests PASS + +RunLTP all tests + [Documentation] Wait ~5hrs to complete 2536 tests + ${log} = Set Variable ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_').log + ${result}= Execute Command /opt/ltp/runltp sudo=True + Append To File ${log} ${result}${\n} + Should Contain ${result} INFO: ltp-pan reported all tests PASS *** Keywords *** Open Connection And Log In - Open Connection ${HOST} - Login ${ROOTUSER} ${ROOTPSWD} + Open Connection ${HOST} + Login With Public Key ${USERNAME} ${SSH_KEYFILE} + +Install LTP + Put File /opt/akraino/ltp.tar.gz /tmp/ltp.tar.gz + Execute Command tar -xf /tmp/ltp.tar.gz -C / + +Uninstall LTP + Execute Command rm -rf /opt/ltp sudo=True + Execute Command rm /tmp/ltp.tar.gz +Download Logs + SSHLibrary.Get File /opt/ltp/output/* ${OUTPUT DIR}/output/ + Execute Command rm -rf /opt/ltp/output/* sudo=True + SSHLibrary.Get File /opt/ltp/results/* ${OUTPUT DIR}/results/ + Execute Command rm -rf /opt/ltp/results/* sudo=True \ No newline at end of file diff --git a/tests/os/ltp/variables.resource b/tests/os/ltp/variables.resource deleted file mode 100644 index 6f46166..0000000 --- a/tests/os/ltp/variables.resource +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright (c) 2019 AT&T Intellectual Property. # -# Copyright (c) 2019 Nokia. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you maynot use this file except in compliance with the License. # -# # -# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -############################################################################## - -*** Variables *** -# Manual test: robot ltp.robot - -${HOST} aknode109 # cluster's master node address -${ROOTUSER} root # Required root user to log in to the host -${ROOTPSWD} root_passwd # Required root password to log in to the host -- 2.16.6