bunpen: add some integration tests (they fail heh)

This commit is contained in:
2024-09-05 02:37:41 +00:00
parent e97302a453
commit 24eefbeded
3 changed files with 21 additions and 1 deletions

View File

@@ -9,5 +9,6 @@ install:
test:
hare test
PATH=$(PWD):$(PATH) ./integration_test
.PHONY: all install test

View File

@@ -1,6 +1,7 @@
{
hareHook,
stdenv,
which,
}: stdenv.mkDerivation {
pname = "bunpen";
version = "0.1.0";
@@ -9,7 +10,9 @@
nativeBuildInputs = [ hareHook ];
makeFlags = [ "PREFIX=${builtins.placeholder "out"}" ];
doCheck = true;
nativeCheckInputs = [ which ];
# doCheck = true; #< TODO: fix tests!
meta = {
description = "userspace sandbox helper";

View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -xeu
# trivial:
bunpen --bunpen-path / $(which true)
# invoke by path
bunpen --bunpen-path / true
# forwards stdout
stdout=$(bunpen --bunpen-path / echo "hello")
test "$stdout" -eq "hello"
# forwards exit code
bunpen --bunpen-path / false && exit false || true