Skip to content

Commit e48e405

Browse files
committed
nfstest: add makefile target to show test results
Under the hood, it more or less just does 'find ... | xargs cat'. It shows the text results files for the most recent kernel run. You can show the results for a different kernel by overriding the LAST_KERNEL variable, e.g. $ LAST_KERNEL=6.13.4-300.fc41.x86_64 make nfstest-show-results Note that since the nfstest log files have a date and timestamp in the filename, it's possible to accumulate logs from multiple test runs. If you're showing the results from the most recent kernel, then we'll only show the logs from the most recent run (i.e. logs that are in the last-run directory). But if you're showing the results from an older kernel, then we'll show all the logs in that directory (but you can change that by overriding the PATTERN variable). Signed-off-by: Scott Mayhew <[email protected]>
1 parent df3e793 commit e48e405

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

workflows/nfstest/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ NFSTEST_KERNEL_CI_LOOP := scripts/workflows/nfstest/run_kernel_ci.sh
5353
NFSTEST_KERNEL_CI_LOOP_KOTD := scripts/workflows/nfstest/run_kernel_ci_kotd.sh
5454
endif # CONFIG_KERNEL_CI
5555

56+
ifndef LAST_KERNEL
57+
LAST_KERNEL := $(shell cat workflows/nfstest/results/last-kernel.txt 2>/dev/null)
58+
endif
59+
60+
ifeq ($(LAST_KERNEL), $(shell cat workflows/nfstest/results/last-kernel.txt 2>/dev/null))
61+
FIND_PATH := workflows/nfstest/results/last-run
62+
else
63+
FIND_PATH := workflows/nfstest/results/$(LAST_KERNEL)
64+
endif
65+
66+
ifndef PATTERN
67+
PATTERN := -name "*.log"
68+
endif
69+
70+
ifndef XARGS_ARGS
71+
XARGS_ARGS := -I {} bash -c 'echo "{}:"; cat {}; echo;'
72+
endif
73+
5674
nfstest:
5775
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
5876
-f 30 -i hosts playbooks/nfstest.yml \
@@ -88,6 +106,11 @@ nfstest-dev-reset:
88106
--tags vars,reset \
89107
--extra-vars=@./extra_vars.yaml
90108

109+
nfstest-show-results:
110+
@find $(FIND_PATH) -type f $(PATTERN) \
111+
| xargs $(XARGS_ARGS) \
112+
| sed '$${/^$$/d;}'
113+
91114
nfstest-help-menu:
92115
@echo "nfstest options:"
93116
@echo "nfstest - Git clone nfstest and install it"

0 commit comments

Comments
 (0)