blob: fd6c6dbbf9fc3e4d29fe97166c664f390c61d7ba [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
29 ${command_output}= Run docker inspect --format "ID: {{.ID}} RESTARTS: {{.RestartCount}} NAME: {{.Name}}" $(docker ps -aq) | grep -v ": 0" > ${FILE_PATH}/container_restart_counts_$(date "+%Y.%m.%d-%H.%M.%S")
Suchitra Vemuri270398d2018-01-25 23:36:30 -080030 Log ${command_output}
Suchitra Vemurib5a36d02018-01-31 17:02:31 -080031 Should Be Empty ${command_output}
Suchitra Vemuri270398d2018-01-25 23:36:30 -080032
33Verify Memory Utilization on the Containers
34 [Documentation] Display the memory utilization for the containers
Suchitra Vemurib5a36d02018-01-31 17:02:31 -080035 [Tags] Container_Memory_Usage
36 ${command_output}= Run docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" $(docker ps -a --format '{{.Names}}') > /tmp/mem_log
37 ${cat_output}= Run cat /tmp/mem_log
38 ${count}= Run cat /tmp/mem_log | wc -l
39 ${command_output1}= Run mv /tmp/mem_log ${FILE_PATH}/container_mem_usage_$(date "+%Y.%m.%d-%H.%M.%S")
Suchitra Vemuri270398d2018-01-25 23:36:30 -080040 Should Not Be Empty ${count}