cri-o/test/testdata
Antonio Murdaca a11b8cd8ec
sandbox, ctr: SELinux fixes
server: fix selinux labels for pod and containers

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

sandbox: set selinux labels from request, not defaults

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

container_create: use sandbox's selinux if container's nil

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

sandbox: correctly init selinux labels

First, we weren't correctly initializing selinux labels. If any of
(level, user, role, type) was missing from kube selinux options, we
were erroring out. This is wrong as kube sends just `level=s0`
sometimes and docker itself allows `--security-opt label=level:s0`.
This patch directly initializes selinux labels, correctly, and adds a
test to verify it.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

test: testdata: use container_runtime_t selinux type

RHEL SELinux policy doesn't have `container_t` type but we're using it
in our fixtures. That means Fedora integration tests pass because
`container_t` is in Fedora's container policy but RHEL is broken.
Fix it by using `container_runtime_t` which is aliased in Fedora policy
to `container_t`.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-09-17 22:40:17 +02:00
..
apparmor_test_deny_write add test cases 2016-12-01 21:42:13 +08:00
container_config.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_by_imageid.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_hostport.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_logging.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_resolvconf.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_resolvconf_ro.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_config_seccomp.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
container_exit_test.json server: fix set caps on container create 2017-05-05 16:31:52 +02:00
container_redis.json test: testdata: get rid of memory limits 2017-05-17 17:30:11 +02:00
container_redis_device.json test: testdata: get rid of memory limits 2017-05-17 17:30:11 +02:00
fake_ocid_default Rename ocid to crio. 2017-05-12 09:56:06 -04:00
README.md Rename ocid to crio. 2017-05-12 09:56:06 -04:00
sandbox_config.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
sandbox_config_hostnet.json testdata: Remove hostport from sandbox_config 2017-06-22 08:51:50 -07:00
sandbox_config_hostport.json test: hostport network test 2017-06-22 15:46:15 -07:00
sandbox_config_seccomp.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00
sandbox_config_selinux.json sandbox, ctr: SELinux fixes 2017-09-17 22:40:17 +02:00

In terminal 1:

sudo ./crio

In terminal 2:

sudo ./crioctl runtimeversion

sudo rm -rf /var/lib/containers/storage/sandboxes/podsandbox1
sudo ./crioctl pod run --config testdata/sandbox_config.json

sudo rm -rf /var/lib/containers/storage/containers/container1
sudo ./crioctl container create --pod podsandbox1 --config testdata/container_config.json