Add testcase for createdAt timestamp restore
@@ -22,11 +22,12 @@ function teardown() {
[ "$status" -eq 0 ]
pod_list_info="$output"
- run crictl inspectp -o table "$pod_id"
+ run crictl inspectp -o json "$pod_id"
echo "$output"
[ "$status" -eq 0 ]
- pod_status_info=`echo "$output" | grep Status`
- pod_ip=`echo "$output" | grep IP`
+ pod_status_info=`echo "$output" | jq ".status.state"`
+ pod_ip=`echo "$output" | jq ".status.ip"`
+ pod_created_at=`echo "$output" | jq ".status.createdAt"`
run crictl create "$pod_id" "$TESTDATA"/container_config.json "$TESTDATA"/sandbox_config.json
echo "$output"
@@ -57,13 +58,15 @@ function teardown() {
[ "$status" -eq 0 ]
[[ "${output}" == "${pod_list_info}" ]]
- run crictl inspectp -o table "$pod_id"
+ run crictl inspectp -o json "$pod_id"
echo "$output"
[ "$status" -eq 0 ]
- status_output=`echo "$output" | grep Status`
- ip_output=`echo "$output" | grep IP`
+ status_output=`echo "$output" | jq ".status.state"`
+ ip_output=`echo "$output" | jq ".status.ip"`
+ created_at_output=`echo "$output" | jq ".status.createdAt"`
[[ "${status_output}" == "${pod_status_info}" ]]
[[ "${ip_output}" == "${pod_ip}" ]]
+ [[ "${created_at_output}" == "${pod_created_at}" ]]
run crictl ps --quiet --all
echo "$output"
