blob: 0b9b22c2d8f274b14e7534748961bf3599b11956 [file] [log] [blame]
Suchitra Vemuri270398d2018-01-25 23:36:30 -08001# Copyright 2017-present Radisys Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16*** Settings ***
17Documentation Test suite for checking results collected by various commands on the soak server
18Library OperatingSystem
19Library ../cord-api/Framework/utils/onosUtils.py
20Library ../cord-api/Framework/utils/utils.py
21
22*** Variables ***
Suchitra Vemurib5a36d02018-01-31 17:02:31 -080023${FILE_PATH} /home/cord/SoakTest_Logs
Suchitra Vemuri270398d2018-01-25 23:36:30 -080024
25*** Test Cases ***
26Verify Docker Containers Restart Status
27 [Documentation] Verify that no containers have been restarted
Suchitra Vemurib5a36d02018-01-31 17:02:31 -080028 [Tags] Restart_Status
Suchitra Vemuride95a282018-02-14 16:04:39 -080029 ${command_output}= Run docker inspect --format "ID: {{.ID}} RESTARTS: {{.RestartCount}} NAME: {{.Name}}" $(docker ps -aq) | grep -v ": 0" > /tmp/count_log
30 Log To Console ${command_output}
31 ${file_output}= Run cat /tmp/count_log
32 ${count}= Run cat /tmp/count_log | wc -l
33 Log ${file_output}
34 ${command_output1}= Run sudo mv /tmp/count_log ${FILE_PATH}/container_restarts$(date "+%Y.%m.%d-%H.%M.%S")
35 Should Be Empty ${count}
Suchitra Vemuri270398d2018-01-25 23:36:30 -080036
37Verify Memory Utilization on the Containers
38 [Documentation] Display the memory utilization for the containers
Suchitra Vemurib5a36d02018-01-31 17:02:31 -080039 [Tags] Container_Memory_Usage
40 ${command_output}= Run docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" $(docker ps -a --format '{{.Names}}') > /tmp/mem_log
41 ${cat_output}= Run cat /tmp/mem_log
42 ${count}= Run cat /tmp/mem_log | wc -l
Suchitra Vemuride95a282018-02-14 16:04:39 -080043 ${command_output1}= Run sudo mv /tmp/mem_log ${FILE_PATH}/container_mem_usage_$(date "+%Y.%m.%d-%H.%M.%S")
Suchitra Vemuri270398d2018-01-25 23:36:30 -080044 Should Not Be Empty ${count}