freeze: add freeze_thaw test

Change-Id: I31db80b89adca9ac354a96ad21073b269d8a0e24
This commit is contained in:
TOIDA,Suguru
2019-09-18 19:00:05 +09:00
committed by Masamichi Takagi
parent 83ade5cdcd
commit ec31d72483
70 changed files with 1054 additions and 0 deletions

45
test/freeze_thaw/function Normal file
View File

@@ -0,0 +1,45 @@
#!/bin/env bash
# function COPYRIGHT FUJITSU LIMITED 2019
this_script_dir="$(cd "$(dirname "${BASH_SOURCE:-${(%):-%N}}")"; pwd)"
cmd_dir="$(cd "$this_script_dir/cmd"; pwd)"
mkdir -p "$this_script_dir/work"
work_dir="$(cd "$this_script_dir/work"; pwd)"
mcexec="$this_script_dir/mcexec"
hello="$cmd_dir/helloworld"
fork="$cmd_dir/fork"
thread="$cmd_dir/pthread_create"
is_os_freeze()
{
local status=`"$this_script_dir/ihkosctl" 0 get status`
if [ "$status" = "FROZEN" ]; then
return 0
fi
return 1
}
is_os_running()
{
local status=`"$this_script_dir/ihkosctl" 0 get status`
if [ "$status" = "RUNNING" ]; then
return 0
fi
return 1
}
freeze()
{
sudo "$cmd_dir/freeze" 0
local ret=$?
sleep 1
return $ret
}
thaw()
{
sudo "$cmd_dir/thaw" 0
local ret=$?
sleep 1
return $ret
}