From 4900bd2808039a0f87fe424083114f8a42a411ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Tue, 22 Sep 2026 23:15:54 -0300 Subject: [PATCH] docs: document native test entry points --- xCAT-test/README.md | 1 + xCAT-test/integration/README.md | 11 ++++++++++ xCAT-test/native/README.md | 37 +++++++++++++++++++++++++++++++++ xCAT-test/unit/README.md | 4 ++++ 4 files changed, 53 insertions(+) create mode 100644 xCAT-test/native/README.md diff --git a/xCAT-test/README.md b/xCAT-test/README.md index 01fbe54d2..3fc8f03b4 100644 --- a/xCAT-test/README.md +++ b/xCAT-test/README.md @@ -7,6 +7,7 @@ language: | --------- | -------- | ------ | | Perl unit tests | `xCAT-test/unit/*.t` | `prove -r xCAT-test/unit` | | Shell unit tests | `xCAT-test/bats/*.bats` | `bats -r xCAT-test/bats` | +| Native host tests | `xCAT-test/native/*.t` | Explicit lab runs; see [native/README.md](native/README.md) | | CLI functional tests | `xCAT-test/autotest/testcase/` and `xCAT-test/autotest/bundle/` | `xcattest -f -t ` or `xcattest -f -b ` | Use Perl `.t` tests for Perl modules, Perl scripts, templates, and repository diff --git a/xCAT-test/integration/README.md b/xCAT-test/integration/README.md index e9cf547b8..847a3a300 100644 --- a/xCAT-test/integration/README.md +++ b/xCAT-test/integration/README.md @@ -56,6 +56,17 @@ A test belongs in `integration/` when it needs something the checkout cannot pro ## Environment guards +`openeuler_postscript_repositories.t` builds and signs RPM fixtures and runs real +DNF transactions. Enable it explicitly on a disposable openEuler host: + +``` +sudo env XCAT_NATIVE_REPOSITORIES=1 prove -v \ + xCAT-test/integration/openeuler_postscript_repositories.t +``` + +The Perl test builds the RPM fixtures directly. Its DNF adapter records arguments +and uses only local fixture repositories, with a fixed fixture release version. + Tests with optional runtime dependencies guard with `plan skip_all` -- an MN with no Kea installed should skip the Kea tests, not go red. The `HTML::Form` test is different: it verifies a required installed dependency and fails when that module is absent. A diff --git a/xCAT-test/native/README.md b/xCAT-test/native/README.md new file mode 100644 index 000000000..2f68a42d4 --- /dev/null +++ b/xCAT-test/native/README.md @@ -0,0 +1,37 @@ +# Native host tests + +These tests use the source checkout with RPM tools, Linux namespaces or real +service binaries. They are separate from `unit/` and are not discovered by the +default pull-request unit run. Run them explicitly on a disposable Linux host. + +Run the package and unprivileged namespace cases as an ordinary user: + +``` +prove xCAT-test/native/buildrpms_openeuler.t \ + xCAT-test/native/buildrpms_release_openeuler.t \ + xCAT-test/native/genesis_openeuler*.t \ + xCAT-test/native/openeuler_package_policy.t +``` + +Run the isolated system cases as root: + +``` +sudo prove xCAT-test/native/ip_forwarding.t \ + xCAT-test/native/openeuler_genimage_transactions.t \ + xCAT-test/native/openeuler_install_repositories.t \ + xCAT-test/native/openeuler_networking.t \ + xCAT-test/native/openeuler_xcatroot.t \ + xCAT-test/native/remoteshell_hostkeys_openeuler.t \ + xCAT-test/native/syslog_openeuler*.t +``` + +The PostgreSQL case starts a private server with only a Unix socket. Run it as +an ordinary user with `XCAT_TEST_PG_BINDIR` set to the directory containing +`initdb`, `pg_ctl`, `postgres`, `psql` and `createdb`: + +``` +XCAT_TEST_PG_BINDIR=/usr/bin prove xCAT-test/native/pgsqlsetup_native_schema.t +``` + +Check the TAP output for skipped prerequisites. A successful `prove` exit with +skipped cases does not qualify those cases. diff --git a/xCAT-test/unit/README.md b/xCAT-test/unit/README.md index daff2691c..2677e3369 100644 --- a/xCAT-test/unit/README.md +++ b/xCAT-test/unit/README.md @@ -38,6 +38,10 @@ skip. The CI takes a copy of the checkout before the build for this reason; see ## What does not belong here +Tests that build RPMs, create Linux namespaces or start service binaries belong +in [`../native`](../native/README.md). They run explicitly on a suitable host, +outside the default unit suite. + Anything that needs an installed xCAT, a populated `/install`, a real service binary or a live daemon. Those go in [`../integration`](../integration/README.md) and run on a management node through `xcattest`. Both suites run on every pull request -- the