test/ctr.bats: skip privileged test when userns
test/ctr.bats: skip privileged test when userns

When I run this particular test case like this:

	CONTAINER_UID_MAPPINGS="0:100000:100000" \
		CONTAINER_GID_MAPPINGS="0:200000:100000" \
		CONTAINER_MANAGE_NS_LIFECYCLE=false \
		CONTAINER_RUNTIME=crun \
		CONTAINER_DEFAULT_RUNTIME=crun \
		RUNTIME_NAME=crun \
		RUNTIME_ROOT=/run/crun \
		RUNTIME_TYPE=oci \
		bats -f 'privileged' ctr.bats

I get the following result:

	 - privileged ctr device add (skipped: userNS enabled)
	 - privileged ctr add duplicate device as host (skipped: userNS enabled)
	 ✗ privileged ctr -- check for rw mounts
	   (in test file ctr.bats, line 951)
	     `ctr_id=$(crictl create "$pod_id" "$newconfig" "$sandbox_config")' failed
	   level=info msg="The manage-ns-lifecycle option is being deprecated, and will be unconditionally true in the future"
	   level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL"
	   time="2020-10-26T19:23:01-07:00" level=fatal msg="creating container: rpc error: code = Unknown desc = container create failed: create device `/dev/tty`: No such device or address\n"

With runc instead of crun, the error message is basically the same:

	   time="2020-10-26T19:32:49-07:00" level=fatal msg="creating container: rpc error: code = Unknown desc = container create failed: time=\"2020-10-26T19:32:49-07:00\" level=warning msg=\"exit status 1\"\ntime=\"2020-10-26T19:32:49-07:00\" level=error msg=\"container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:71: creating device nodes caused: open /tmp/tmp.C693hO5IGp/crio/overlay/cd9051bbaeb980b4e8b856ae3e450c89a1acb5b643b473226a761867bde83dca/merged/dev/tty: no such device or address\"\n"

Obviously, we can't have a privileged container with userns,
so this test need to be skipped.

What I don't understand is why our CI is not catching this.
I have a theory though...

Signed-off-by: Kir Kolyshkin <3a017b8ddb3f9cf3e4a59978b004111bdeb97f08@gmail.com>

nalind/cri-o,kubernetes-incubator/cri-o,kubernetes-incubator/cri-o,kubernetes-incubator/ocid,kubernetes-incubator/ocid,kubernetes-incubator/ocid,kubernetes-incubator/cri-o,kubernetes-incubator/cri-o,nalind/cri-o,nalind/cri-o