From cad6aed526b38d52f13266120f9a4381f9a22cad Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Fri, 17 May 2024 17:42:11 +0100 Subject: Tests: initial "wasm-wasi-component" test --- test/unit/check/cargo_component.py | 4 ++++ test/unit/check/discover_available.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/unit/check/cargo_component.py (limited to 'test/unit/check') diff --git a/test/unit/check/cargo_component.py b/test/unit/check/cargo_component.py new file mode 100644 index 00000000..1c194bfc --- /dev/null +++ b/test/unit/check/cargo_component.py @@ -0,0 +1,4 @@ +from unit.applications.lang.wasm_component import ApplicationWasmComponent + +def check_cargo_component(): + return ApplicationWasmComponent.prepare_env('hello_world') is not None diff --git a/test/unit/check/discover_available.py b/test/unit/check/discover_available.py index 1383a0c3..99e63604 100644 --- a/test/unit/check/discover_available.py +++ b/test/unit/check/discover_available.py @@ -1,6 +1,7 @@ import subprocess import sys +from unit.check.cargo_component import check_cargo_component from unit.check.chroot import check_chroot from unit.check.go import check_go from unit.check.isolation import check_isolation @@ -28,7 +29,7 @@ def discover_available(unit): # discover modules from log file - for module in Log.findall(r'module: ([a-zA-Z]+) (.*) ".*"$'): + for module in Log.findall(r'module: ([a-zA-Z\-]+) (.*) ".*"$'): versions = option.available['modules'].setdefault(module[0], []) if module[1] not in versions: versions.append(module[1]) @@ -44,6 +45,7 @@ def discover_available(unit): # Discover features using check. Features should be discovered after # modules since some features can require modules. + option.available['features']['cargo_component'] = check_cargo_component() option.available['features']['chroot'] = check_chroot() option.available['features']['isolation'] = check_isolation() option.available['features']['unix_abstract'] = check_unix_abstract() -- cgit