2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 23:28:19 +00:00
Commit Graph

108 Commits

Author SHA1 Message Date
Daniel Hilst 3582c6ab19 fix(xcat-core): xcattest runs no test case on an openEuler management node
xcattest reports "Test case <name> has an invalid OS option - Linux" and then
"There is no valid case to run", so every case is skipped on openEuler.
Recorded on an openEuler 24.03 LTS SP4 management node with xCAT 2.20.0: both
flat provisioning cases were rejected and the run measured nothing.

Two causes, both in the os: comparison in xCAT-test/xcattest. get_current_os
takes the /etc/os-release branch, finds no sles, and falls off the end of that
branch, so it returns the exit status of the failed grep, 256, which names no
distribution. And a case marked os:Linux expands to exactly rhels, sles and
ubuntu, so openEuler would be rejected even by a correct get_current_os.

Both halves move into xCAT::Test::OS. xcattest finds it beside itself and the
package installs it at <prefix>/lib/perl. current_os takes a path prefix, so a
test describes a system by writing release files into a scratch tree. openEuler
is named in both halves and nothing else changes.

xCAT-test/unit/xcattest_os_selection.t covers it. Removing openeuler from
linux_aliases fails two checks, and removing the openEuler branch from
current_os fails three. A further case gives a root both /etc/redhat-release
and an openEuler /etc/os-release and asserts rhels10, so the precedence is
named: openEuler ships neither that file nor /etc/lsb-release.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-30 19:59:41 -03:00
Daniel Hilst b91795a8f4 test(xcat-core): a failed extraction in thirteen test files stops the whole suite
Thirteen test files this branch adds call BAIL_OUT at fifty-one places:
an extraction that stopped matching, a fixture that is not there, a
harness that wrote no log. prove stops every remaining file on a
bail-out, not only the file that called it, so one of them hides the
results of every test that would have run after it. die is just as loud
and costs only its own file.

Fifteen comments the branch added also carried the incident rather than
the constraint. Three pasted an error transcript, five traced a failure
from a macro or a missing file out to a node that never boots, and the
rest counted call sites, package sizes or dracut build numbers. Each now
states the one fact the reader cannot re-derive from the code.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-14 08:46:57 -03:00
Daniel Hilst f7462389b6 fix(xcat-core): xcattest reports only the check where a case stopped
A failing case named one failed check and no result at all for the checks after it,
although the commands of the case kept running. The first [Failed] line was read as
the cause of the failure three times this week, and each time the real fault was a
later check: a riscv64 cell reported a makedns check 160 lines before rpower could
not start the domain.

run_case in xCAT-test/xcattest used one variable, $failflag, for two facts: the
result of the case, and the result of the check being reported. Every branch read
$failflag to decide whether to print [Pass] or [Failed], so a check that ran after a
failed one always read as failed. The guard "last if ($failflag)" at the top of the
check loop hid that, and hid every later check with it.

The result of a check is now $checkfail, set and read inside one iteration. A
continue block carries it into $failflag, which keeps the result of the case. The
guard and the per-branch "last" statements are gone, so each check reports what it
found. The output ~~ branch no longer clears $failflag on a match, which without the
guard would have turned a failed case into a passing one.

xCAT-test/unit/xcattest_report_every_check.t runs the harness over a fixture case and
asserts on the CHECK lines it writes. Without this change it reports two of four
checks, and one of two failed checks. A case whose checks all pass logs the same text
before and after: no truncation could happen while $failflag stayed 0.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-04 16:39:33 -03:00
Daniel Hilst c0731a5e33 fix(xcat-test): run testcase commands under bash, not /bin/sh
xcattest's runcmd ran each RUN: command via Perl backticks, i.e. /bin/sh.
On Ubuntu /bin/sh is dash, so testcases using bashisms ([ x == y ],
[[ ... ]]) error with "unexpected operator": the [ exits non-zero, the
enclosing if is taken as false, and the case's distro-specific branch is
silently skipped while the case still reports Passed -- a false pass. Run
the command through bash via list-form open() so no intervening /bin/sh
re-parses or re-expands the command's embedded quotes and backticks. EL
is unaffected (its /bin/sh is already bash).

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-24 14:20:27 -03:00
Vinícius Ferrão 01150ac34b fix: reset newcmdstart between files in xcattest load_case
When a test case file is missing the end marker and the last line is a
cmd: directive, $newcmdstart stays set. The parser then appends lines
from the next file into the current command. If that next file is a
shell script (like simulatorctl.sh in the testcase tree), thousands of
lines of Perl/bash get concatenated and executed.

Reset $newcmdstart after closing each file to prevent state leaking
between files.

Fixes #5255
2026-04-26 15:28:11 -03:00
Daniel Hilst Selli 3767e0a25f fix: Fix typo in xCAT-test/xcattest
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-03-05 08:26:50 -03:00
Mark Gurevich 9d1e473d2c Allow os: testcase tag to specify rhels version 2022-08-26 14:01:31 -04:00
Mark Gurevich 47ed0d3650 Debug command output38 2022-07-14 15:47:11 -04:00
Mark Gurevich 67be19e97d Debug command output37 2022-07-14 15:31:16 -04:00
Mark Gurevich 802567ad52 Debug command output14 2022-07-13 16:28:26 -04:00
Mark Gurevich 7a103ad705 Debug command output13 2022-07-13 15:46:51 -04:00
Mark Gurevich 313244045a Debug command output12 2022-07-13 15:15:54 -04:00
Mark Gurevich b2e74483c7 Debug command output11 2022-07-13 14:50:12 -04:00
Mark Gurevich 96392c2785 Debug command output10 2022-07-13 14:23:21 -04:00
Mark Gurevich a07deab1ab Debug command output8 2022-07-13 13:41:23 -04:00
Mark Gurevich d3cbfa2b92 Debug command output7 2022-07-13 13:29:37 -04:00
Mark Gurevich 6eb9b5ef60 Debug command output6 2022-07-13 13:15:41 -04:00
Mark Gurevich 40e024975d Debug command output5 2022-07-13 12:00:19 -04:00
Mark Gurevich 344cf05f9c Debug command output4 2022-07-13 11:40:31 -04:00
Mark Gurevich 359c7b349e Debug command output3 2022-07-13 11:27:26 -04:00
Mark Gurevich 72ee3d9ac9 Debug command output 2022-07-13 11:12:07 -04:00
besawn ee759c065d Modified xcattest check:output to enforce stricter syntax checking 2022-04-21 16:02:29 -04:00
besawn 0bf020f200 Added additional validation to check:output 2022-04-21 15:47:14 -04:00
Wai Yee Wong 19b6ee3b5a Improve reporting of invalid OS, ARCH and HCP 2020-10-29 10:06:24 -04:00
Chen Hanxiao 8bb7671a23 xcattest: proper replace vars in test cases
xcattest will replace vars in testcases.
But vars with same prefix will lead to a replacement failure.

Issue:
XCATTEST_PORT=500 XCATTEST_CN=xcat-com001 XCATTEST_PDU=xmount XCATTEST_PDUIP=192.168.200.100 xcattest -t mkdef_pdu_object

cmd:mkdef $$PDU groups=pdu ip=$$PDUIP mgt=pdu nodetype=pdu

will be:

RUN:mkdef xmount groups=pdu ip=xmountIP mgt=pdu nodetype=pdu

$$PDUIP had no chance to be substituted.

Reported-by: Yang Jian <fun_yang@foxmail.com>
Signed-off-by: Chen Hanxiao <chen_han_xiao@126.com>
2020-06-09 16:54:43 +08:00
Wai Yee Wong c58a9ab092 Fix a typo from xcat-inventory to xcat_inventory 2020-03-02 15:34:39 -05:00
cxhong 5fd937b133 Add isserv to sle15 pkglist 2020-01-14 09:49:48 -05:00
Weihua Hu c0a7154bf6 fix issue 5881: xcattest failed to add component directory name as default label (#5882) 2018-12-11 13:42:54 +08:00
Weihua Hu 5559e44b4a enhance xcattest for issue 5773 and task 383 (#5782) 2018-11-09 18:25:27 +08:00
Weihua Hu 2220828d78 fix bug #5612 of xcattest (#5613) 2018-09-07 11:14:19 +08:00
GONG Jie 0864fac6d4 Remove trailing spaces in file xCAT-test/xcattest 2017-12-31 23:59:59 +00:00
Weihua Hu f894700087 Make xcattest can supprot multiple values for key words hcp and arch (#5379) 2018-07-09 13:25:00 +08:00
Weihua Hu 69d4ef25af Refine option l of xcattest (#5293) 2018-06-22 17:22:59 +08:00
robin2008 c6745a3dd5 enhance xcattest for better debug new case and acquire attribute not only for node:
- to support customize the testcase dir with environment variable XCATTEST_CASEDIR
 - to allow to print more debug info with environment variable XCATTEST_DEBUG
 - to add a new func to get general object attribute (__GETOBJECTATTR(...)__)
2018-06-20 09:13:29 +08:00
Weihua Hu 61cbe03b93 Enhance xcattest to support label search (#5280)
* enhance xcattest to support label search
2018-06-13 17:32:05 +08:00
hu-weihua 4dbd36c3da add more test cases for validation 2018-03-20 05:27:16 -04:00
hu-weihua bad2b94585 To handle one case which have 2 implementations, which one is for specific platform, on is for all platforms 2017-12-01 01:02:11 -05:00
Victor Hu 11ee234896 Add space between at and the time 2017-11-27 10:55:53 -05:00
Weihua Hu 27dea1a2a9 fix issue #4354 :The XCATTEST_CN in xcattest can not detect HCP as config file (#4355) 2017-11-21 02:23:00 -06:00
hu-weihua b627f069f4 enhance to better support the cases which have the same case name but with multiple implementation 2017-11-13 22:31:37 -05:00
hu-weihua 499a619577 modify depending on baiyuan's comment 2017-11-10 04:29:26 -05:00
hu-weihua 5add18f790 Fix bugs for xcattest: 3411,4189,3138,4204 2017-11-09 23:58:09 -05:00
hu-weihua 570daf3fa4 Fix typo in test case 2017-09-20 01:37:21 -04:00
Bin Xu 6e9825f0d1 1, test case for nodeset -V to show server info
2, allow xcattest get 'var' type config from environment variable when no config file specified.
For example, when given 'XCATTEST_CN=fake1', xcattest will set $$CN=fake1
2017-08-03 16:45:44 +08:00
hu-weihua d1b823b4b3 fix bug: failed to load config file which value include comma in object section 2017-07-20 03:46:46 -04:00
hu-weihua 5215b690f9 Modify one bug:Use of implicit split to @_ is deprecated at xcattest line 1059 2017-06-06 02:47:52 -04:00
hu-weihua 5056bea7db modify typo 2017-05-31 05:13:06 -04:00
hu-weihua 78bc818748 Modify 2 bugs for xcattest 2017-05-31 01:26:43 -04:00
hu-weihua 21c955467a Fix automation bug: xcattest failed to load case depending on arch label 2017-05-24 03:47:52 -04:00
hu-weihua aeb2f4e5fa Modify a typo for xcattest 2017-05-22 22:27:16 -04:00