Skip to content

Standardize run tests - #280

Open
vidyalakshmir wants to merge 3 commits into
mainfrom
standardize-run-tests
Open

vidyalakshmir wants to merge 3 commits into
mainfrom
standardize-run-tests

Conversation

@vidyalakshmir

Copy link
Copy Markdown
Contributor
  • Adds TESTING.md which specifies the app test requirements
  • Adds scripts/test_lib.sh which is a common script to skip tests
  • Adds standardize app test scripts for all apps (except cpython and tinycc).

@Uk-jake

Uk-jake commented Aug 20, 2026

Copy link
Copy Markdown

Thanks for the work. I’ll start on the apps pipeline using this.

I just confirmed my understanding. Are 11 apps (awk, bash, coreutils, curl, git, grep, lmbench, make, nginx, perl, sed) standardized, while cpython and tinycc are excluded?

Additionally, to run make test for all 11 apps, I think we should also update TESTABLE_APPS in the Makefile

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author

Yes, need to update TESTABLE_APPS in the Makefile

There are two categories of test suites for apps :

  1. Default test suite shipped from the app developers
  2. Test suite we developed for the apps.

Adapting test suite of apps to run with lind-wasm requires some porting effort. Hence, we have
Cpython - Category 1
Coreutils - Category 1 and 2
All other apps - Category 2

We have Cpython and coreutils (from category 1) and tinycc pending.

Regarding postgres, I am not completely sure about which category its tests are. @rishabhBudhouliya Do you have more information about postgres test suites.

@Uk-jake

Uk-jake commented Aug 21, 2026

Copy link
Copy Markdown
  • Default test suite shipped from the app developers
  • Test suite we developed for the apps.

Just curious, what is the reason for dividing the tests into Category 1 and 2?

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author
  • Default test suite shipped from the app developers
  • Test suite we developed for the apps.

Just curious, what is the reason for dividing the tests into Category 1 and 2?

Adapting test suite of apps to run with lind-wasm requires some porting effort. Depends on if the app comes with test suite and the porting effort.

@Uk-jake

Uk-jake commented Aug 21, 2026

Copy link
Copy Markdown
  • Default test suite shipped from the app developers
  • Test suite we developed for the apps.

Just curious, what is the reason for dividing the tests into Category 1 and 2?

Adapting test suite of apps to run with lind-wasm requires some porting effort. Depends on if the app comes with test suite and the porting effort.

In that case, is the ideal approach to test both Category 1 and 2? It looks like Coreutils is listed under both categories. Or is it fine to just run either Category 1 or Category 2?

@qianxichen233

Copy link
Copy Markdown
Contributor

Yes, need to update TESTABLE_APPS in the Makefile

There are two categories of test suites for apps :

  1. Default test suite shipped from the app developers
  2. Test suite we developed for the apps.

Adapting test suite of apps to run with lind-wasm requires some porting effort. Hence, we have Cpython - Category 1 Coreutils - Category 1 and 2 All other apps - Category 2

We have Cpython and coreutils (from category 1) and tinycc pending.

Regarding postgres, I am not completely sure about which category its tests are. @rishabhBudhouliya Do you have more information about postgres test suites.

postgres is runnings its own regression testsuite

@rishabhBudhouliya

Copy link
Copy Markdown
Contributor

@vidyalakshmir As Qianxi mentioned, Postgres has its own test suite called pg_regress. The usual way to run it is to spawn a postgres server and then run the pg_regress harness which itself spawns a psql client to talk to the main server and then run a bunch of tests.
It also has a benchmarking test suite called pg_bench but I think that might not be related to the standardization effort.

@rishabhBudhouliya rishabhBudhouliya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vidya for leading the standardization effort. I mostly have app specific behavior related comments. Please let me know how I can help.

Other app related behavior I saw:
Difference in how PASS/FAIL is represented in different app tests results:
[PASS]/[FAIL] is PASS:/FAIL: in curl, git, nginx, lmbench, sed

Comment thread scripts/test_lib.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect nearly every test name contains spaces. Should we use a newline/ pipe delimeter?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes sense

Comment thread sed/run_tests.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like some timeout configs are inconsistent:

  • awk/make/perl/bash/coreutils hardcode TIMEOUT_SECS=N;
  • sed/grep/curl/git use ${TIMEOUT_SECS:-N}.

Comment thread coreutils/run_tests.sh
echo "================================"

if [ "$FAIL" -gt 0 ]; then
exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this exits 1 on failure, with Makefile .SHELLFLAGS := -eu -o pipefail -c + .ONESHELL, a coreutils failure aborts the entire make test run. Is that the intended behavior?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, even if one test fails, need to continue to the next test.

@Uk-jake

Uk-jake commented Aug 27, 2026

Copy link
Copy Markdown

@rishabhBudhouliya, @qianxichen233
I'd appreciate it if you could confirm whether the following result is expected when running 'make test'

I was running 'make test' on thestandardize-run-tests branch.

First, about running the tests at all. The current test target loops over TESTABLE_APPS, but it stops as soon as one suite exits 1. For a CI/CD pipeline, we need a trigger that runs every app's tests even when some of them fail. If we want to use make test as that trigger, the Makefile needs a change along these lines.

test:
	@rc=0; \
	for app in $(APP); do \
	    case " $(TESTABLE_APPS) " in \
	      *" $$app "*) ;; \
	      *) echo "ERROR: unsupported test app '$$app'"; exit 1 ;; \
	    esac; \
	    if [[ -x '$(APPS_ROOT)/'"$$app"'/run_tests.sh' ]]; then \
	        if ! '$(APPS_ROOT)/'"$$app"'/run_tests.sh' "$$app"; then \
	            rc=1; \
	            echo "[FAIL] $$app"; \
	        fi; \
	    else \
	        echo "[SKIP] $$app: missing run_tests.sh"; \
	    fi; \
	done; \
	exit $$rc

Wrapping the call in a conditional keeps set -e from aborting the loop, and make test still exits non-zero if anything failed.

This a result of 'make test' with the change.

app result passed/total
awk PASS 45/45
sed PASS 7/7
curl FAIL 6/25 (5 skipped)
grep FAIL 1/5
git FAIL 4/36
make FAIL 1/22
coreutils FAIL 1/27
bash FAIL 3/162
perl FAIL 1/107
lmbench FAIL did not run
nginx FAIL failed to start

make-test-patched.log

That's more failures than I expected, so I'd appreciate it if you could point out anything I might have missed.
Here's what I ran.

Image: securesystemslab/lind-wasm-dev:latest

  1. make preflight
  2. make merge-sysroot
  3. make <app> and make install-<app> for: awk bash coreutils curl git grep lmbench make nginx perl sed
  4. make test

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author

@rishabhBudhouliya, @qianxichen233 I'd appreciate it if you could confirm whether the following result is expected when running 'make test'

I was running 'make test' on thestandardize-run-tests branch.

First, about running the tests at all. The current test target loops over TESTABLE_APPS, but it stops as soon as one suite exits 1. For a CI/CD pipeline, we need a trigger that runs every app's tests even when some of them fail. If we want to use make test as that trigger, the Makefile needs a change along these lines.

test:
	@rc=0; \
	for app in $(APP); do \
	    case " $(TESTABLE_APPS) " in \
	      *" $$app "*) ;; \
	      *) echo "ERROR: unsupported test app '$$app'"; exit 1 ;; \
	    esac; \
	    if [[ -x '$(APPS_ROOT)/'"$$app"'/run_tests.sh' ]]; then \
	        if ! '$(APPS_ROOT)/'"$$app"'/run_tests.sh' "$$app"; then \
	            rc=1; \
	            echo "[FAIL] $$app"; \
	        fi; \
	    else \
	        echo "[SKIP] $$app: missing run_tests.sh"; \
	    fi; \
	done; \
	exit $$rc

Wrapping the call in a conditional keeps set -e from aborting the loop, and make test still exits non-zero if anything failed.

This a result of 'make test' with the change.

app result passed/total
awk PASS 45/45
sed PASS 7/7
curl FAIL 6/25 (5 skipped)
grep FAIL 1/5
git FAIL 4/36
make FAIL 1/22
coreutils FAIL 1/27
bash FAIL 3/162
perl FAIL 1/107
lmbench FAIL did not run
nginx FAIL failed to start
make-test-patched.raw.log make-test-patched.log

That's more failures than I expected, so I'd appreciate it if you could point out anything I might have missed. Here's what I ran.

Image: securesystemslab/lind-wasm-dev:latest

  1. make preflight
  2. make merge-sysroot
  3. make <app> and make install-<app> for: awk bash coreutils curl git grep lmbench make nginx perl sed
  4. make test

Thanks @Uk-jake You could make necessary changes to Makefile to adapt it to the CI/CD pipeline.

Also, thanks for running the test suites.

It would also help if you could attach or post the errors you face for the failed apps.

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author

So I tried testing some of the apps (curl) which had failures. And seems like the issue is mostly with env::__lind_debug_import has not been defined. I think this is because of debug build being made default for lind-boot. How could we fix this for the apps? @qianxichen233 @Yaxuan-w

lind_run --preload env=lib/libz.so --preload env=lib/libcrypto.so usr/local/bin/curl --version
failed to run main module

Caused by:
    0: failed to invoke command default
    1: unknown import: `env::__lind_debug_import` has not been defined

@rishabhBudhouliya

Copy link
Copy Markdown
Contributor

@vidyalakshmir @qianxichen233 have created a postgres PR for app test standardization: #282

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author

@vidyalakshmir @qianxichen233 have created a postgres PR for app test standardization: #282

Thanks @rishabhBudhouliya

@vidyalakshmir

Copy link
Copy Markdown
Contributor Author

@Uk-jake After running the tests, the two cases worth noting are :

  1. The lind-wasm should NOT have being built enabling debug mode to run with apps.
  2. For apps that require fpcast, lind-wasm should be compiled with fpcast.

@Uk-jake

Uk-jake commented Aug 31, 2026

Copy link
Copy Markdown

@vidyalakshmir, @rishabhBudhouliya
Could you let me know which apps require FPCast?

@rishabhBudhouliya

Copy link
Copy Markdown
Contributor

@Uk-jake
Apps that require fpcast
Bash, coreutils, perl, postgres, nginx, grep, awk, make lmbench

I am not 100% confident but these apps don't require fpcast
binutils, curl, diffutils, ed25519, gcc, git, gnulib, libtirpc, llvm-project, openssl, sed, tinycc, zlib.

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

Successfully merging this pull request may close these issues.

4 participants