Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a test framework #70

Open
ariel-miculas opened this issue Mar 3, 2023 · 2 comments
Open

Implement a test framework #70

ariel-miculas opened this issue Mar 3, 2023 · 2 comments
Assignees

Comments

@ariel-miculas
Copy link
Collaborator

Right now, our only tests are unit tests, which are not enough for more complex scenarios, such as creating an environment in which to test fsverity.
Copying Serge's test suggestion from #67 (comment):

which lxc-create || exit 0
lxcname=$(basename $(mktemp -u))
lxc-create -t download -n $lxcname -- -d alpine -r edge -a amd64
dir=$(mkdir -d)
mkdir -p $dir/oci $dir/mnt
export dir
export lxcname
lxc-usernsexec -s -- << "EOF"
unshare -m -- << "XXX"
set -e
puzzlefs create $HOME/.local/share/lxc/$lxcname/rootfs $dir/oci rfs
puzzlefs mount $dir/oci rfs $dir/mnt
test -e $dir/mnt/etc
diff -Nrup $HOME/.local/share/lxc/$lxcname/rootfs $dir/mnt
XXX
EOF
@ariel-miculas ariel-miculas self-assigned this Mar 3, 2023
@ariel-miculas
Copy link
Collaborator Author

There is support for integration tests in rust ecosystem, we already have one in exe/tests/extract.rs

@ariel-miculas
Copy link
Collaborator Author

Another test that could be added:

#!/bin/bash
FIFO=$(mktemp -u)
mkfifo "$FIFO"
target/debug/puzzlefs mount -i $FIFO -f /tmp/oci-simple first_try /tmp/puzzle&
cat $FIFO ; echo
ls /tmp/puzzle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant