This repository has been archived by the owner on Mar 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #736 from 01org/topic/cri-o-tests
CRI-O integration tests
- Loading branch information
Showing
10 changed files
with
486 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"metadata": { | ||
"name": "podsandbox1-redis" | ||
}, | ||
"image": { | ||
"image": "docker://redis:3.2.3" | ||
}, | ||
"args": [ | ||
"docker-entrypoint.sh", | ||
"redis-server" | ||
], | ||
"working_dir": "/data", | ||
"envs": [ | ||
{ | ||
"key": "PATH", | ||
"value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
}, | ||
{ | ||
"key": "TERM", | ||
"value": "xterm" | ||
}, | ||
{ | ||
"key": "REDIS_VERSION", | ||
"value": "3.2.3" | ||
}, | ||
{ | ||
"key": "REDIS_DOWNLOAD_URL", | ||
"value": "http://download.redis.io/releases/redis-3.2.3.tar.gz" | ||
}, | ||
{ | ||
"key": "REDIS_DOWNLOAD_SHA1", | ||
"value": "92d6d93ef2efc91e595c8bf578bf72baff397507" | ||
} | ||
], | ||
"labels": { | ||
"tier": "backend" | ||
}, | ||
"annotations": { | ||
"pod": "podsandbox1" | ||
}, | ||
"readonly_rootfs": false, | ||
"log_path": "container.log", | ||
"stdin": false, | ||
"stdin_once": false, | ||
"tty": false, | ||
"linux": { | ||
"resources": { | ||
"cpu_period": 10000, | ||
"cpu_quota": 20000, | ||
"cpu_shares": 512, | ||
"memory_limit_in_bytes": 88000000, | ||
"oom_score_adj": 30 | ||
}, | ||
"capabilities": { | ||
"add_capabilities": [ | ||
"sys_admin" | ||
] | ||
}, | ||
"user": { | ||
"uid": 0, | ||
"gid": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default": [ | ||
{ | ||
"type": "insecureAcceptAnything" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"metadata": { | ||
"name": "podsandbox1", | ||
"uid": "redhat-test-ocid", | ||
"namespace": "redhat.test.ocid", | ||
"attempt": 1 | ||
}, | ||
"hostname": "ocic_host", | ||
"log_directory": ".", | ||
"dns_options": { | ||
"servers": [ | ||
"server1.redhat.com", | ||
"server2.redhat.com" | ||
], | ||
"searches": [ | ||
"8.8.8.8" | ||
] | ||
}, | ||
"port_mappings": [ | ||
{ | ||
"name": "port_map1", | ||
"protocol": 1, | ||
"container_port": 80, | ||
"host_port": 4888, | ||
"host_ip": "192.168.0.33" | ||
}, | ||
{ | ||
"name": "port_map2", | ||
"protocol": 2, | ||
"container_port": 81, | ||
"host_port": 4889, | ||
"host_ip": "192.168.0.33" | ||
} | ||
], | ||
"resources": { | ||
"cpu": { | ||
"limits": 3, | ||
"requests": 2 | ||
}, | ||
"memory": { | ||
"limits": 50000000, | ||
"requests": 2000000 | ||
} | ||
}, | ||
"labels": { | ||
"group": "test" | ||
}, | ||
"annotations": { | ||
"owner": "hmeng", | ||
"security.alpha.kubernetes.io/sysctls": "kernel.shm_rmid_forced=1,net.ipv4.ip_local_port_range=1024 65000", | ||
"security.alpha.kubernetes.io/unsafe-sysctls": "kernel.msgmax=8192" , | ||
"security.alpha.kubernetes.io/seccomp/pod": "unconfined" | ||
}, | ||
"linux": { | ||
"cgroup_parent": "/ocid-podsandbox1", | ||
"security_context": { | ||
"namespace_options": { | ||
"host_network": false, | ||
"host_pid": false, | ||
"host_ipc": false | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## cc-oci-runtime integration tests | ||
|
||
### Docker | ||
|
||
1. Enable the Docker integration tests: | ||
|
||
``` | ||
./autogen.sh --enable-docker-tests | ||
``` | ||
|
||
2. Run the Docker integration tests: | ||
|
||
``` | ||
sudo -E make docker-tests | ||
``` | ||
|
||
### CRI-O | ||
|
||
1. Enable the CRI-O integration tests: | ||
|
||
``` | ||
./autogen.sh --enable-crio-tests | ||
``` | ||
|
||
2. Run the CRI-O integration tests: | ||
|
||
``` | ||
sudo -E make crio-tests | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bats | ||
# *-*- Mode: sh; sh-basic-offset: 8; indent-tabs-mode: nil -*-* | ||
|
||
# This file is part of cc-oci-runtime. | ||
# | ||
# Copyright (C) 2017 Intel Corporation | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
||
SRC="${BATS_TEST_DIRNAME}/../../lib/" | ||
TESTDATA="${BATS_TEST_DIRNAME}/../../data/" | ||
|
||
setup() { | ||
source $SRC/test-crio.bats | ||
} | ||
|
||
function teardown() { | ||
cleanup_test | ||
} | ||
|
||
@test "CRI-O redis container start and remove" { | ||
start_ocid | ||
run ocic pod run --config "$TESTDATA"/sandbox_config.json | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
pod_id="$output" | ||
run ocic ctr create --config "$TESTDATA"/container_redis.json --pod "$pod_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
ctr_id="$output" | ||
run ocic ctr start --id "$ctr_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
run ocic ctr remove --id "$ctr_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
run ocic pod stop --id "$pod_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
run ocic pod remove --id "$pod_id" | ||
echo "$output" | ||
[ "$status" -eq 0 ] | ||
cleanup_ctrs | ||
cleanup_pods | ||
stop_ocid | ||
} |
Oops, something went wrong.