Skip to content

Commit

Permalink
tests: Add posix filesystem conformance test
Browse files Browse the repository at this point in the history
Checks that the container's filesystem supports the most common filesystem
operations.

Fixes kata-containers#814

Signed-off-by: Gabriela Cervantes <[email protected]>
  • Loading branch information
GabyCT committed Oct 25, 2018
1 parent 8201389 commit cd19c78
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
19 changes: 19 additions & 0 deletions conformance/posixfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

# Usage: FROM [image name]
FROM debian

# Version of the Dockerfile
LABEL DOCKERFILE_VERSION="1.0"

RUN apt-get update && \
apt-get -y install autoconf git bc libacl1-dev libacl1 acl gcc make perl g++ perl-modules && \
git clone https://github.com/pjd/pjdfstest.git && \
cd pjdfstest && \
autoreconf -ifs && \
./configure && \
make

CMD ["/bin/bash"]
34 changes: 34 additions & 0 deletions conformance/posixfs/fstests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
#
# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

set -e

# General env
SCRIPT_PATH=$(dirname "$(readlink -f "$0")")
source "${SCRIPT_PATH}/../../metrics/lib/common.bash"
source "${SCRIPT_PATH}/../../lib/common.bash"

# Env variables
IMAGE="${IMAGE:-fstest}"
DOCKERFILE="${SCRIPT_PATH}/Dockerfile"
CONT_NAME="${CONT_NAME:-fstest}"
RUNTIME="${RUNTIME:-kata-runtime}"
PAYLOAD_ARGS="${PAYLOAD_ARGS:-tail -f /dev/null}"

function main() {
clean_env
check_dockerfiles_images "$IMAGE" "$DOCKERFILE"
docker run -d --runtime $RUNTIME --name $CONT_NAME $IMAGE $PAYLOAD_ARGS

echo "WARNING: Removing failing tests (Issue https://github.com/kata-containers/runtime/issues/826" >&2
REMOVE_FILES="cd pjdfstest/tests && rm -f chown/00.t chmod/12.t link/00.t mkdir/00.t symlink/03.t mkfifo/00.t mknod/00.t mknod/11.t open/00.t"
docker exec $CONT_NAME bash -c "${REMOVE_FILES}"
docker exec $CONT_NAME bash -c "cd /pjdfstest && prove -r"

clean_env
}

main "$@"

0 comments on commit cd19c78

Please sign in to comment.