diff options
author | Tony Luck <tony.luck@intel.com> | 2020-06-02 09:50:24 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2020-06-02 09:54:43 -0700 |
commit | a850a9da964ae23541f5a1d3f117fe43856a8933 (patch) | |
tree | 959473bc09f538379983036c941a8f625f6817e3 | |
parent | 8be7d2c31ba1514dce4f28ee886fe7719156fbc3 (diff) | |
download | ras-tools-a850a9da964ae23541f5a1d3f117fe43856a8933.tar.gz |
einj_mem_uc: Add explicit "Test passed/failed" messages and exit status
Validation teams using this test would find it easier to build into
a test script if it reported success/fail both with a message, and
by exit code.
Reported-by: Jun J Li <jun.j.li@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | einj_mem_uc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/einj_mem_uc.c b/einj_mem_uc.c index a2eae4e..0f1851a 100644 --- a/einj_mem_uc.c +++ b/einj_mem_uc.c @@ -532,12 +532,18 @@ int main(int argc, char **argv) } if (a_cmci == b_cmci) { printf("Expected CMCI, but none seen\n"); + printf("Test failed\n"); + return 1; } else if (a_cmci < b_cmci + lcpus_persocket) { printf("Unusual number of CMCIs seen: %ld\n", a_cmci - b_cmci); + printf("Test failed\n"); + return 1; } } else { if (a_cmci != b_cmci) { printf("Saw %ld unexpected CMCIs (%ld per socket)\n", a_cmci - b_cmci, (a_cmci - b_cmci) / lcpus_persocket); + printf("Test failed\n"); + return 1; } } @@ -549,5 +555,6 @@ int main(int argc, char **argv) } } + printf("Test passed\n"); return 0; } |