mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 15:18:19 +00:00
docs: document native test entry points
This commit is contained in:
@@ -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 <cluster.conf> -t <case>` or `xcattest -f <cluster.conf> -b <bundle>` |
|
||||
|
||||
Use Perl `.t` tests for Perl modules, Perl scripts, templates, and repository
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user