1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-05 15:48:40 +01:00
Files
glusterfs/tests/utils/testn.sh
Niels de Vos 9d6fab6910 tests: add a helper script to identify line-numbers and commands of test-cases
Use the tests/utils/testn.sh after a regression test failed to identify
what command/line number belongs to the test-number.

Jenkins will have something like this in the console output:

    Test Summary Report
    -------------------
    ./tests/bugs/quota/bug-1087198.t
      Failed test:  18

Call the script like:

    $ ./tests/utils/testn.sh ./tests/bugs/quota/bug-1087198.t 18
    56 TEST grep -e "\"Usage crossed....

BUG: 1200174
Change-Id: I661c1178d7f5bc50fd40679232c65734c2bc5477
Original-author: Pranith Kumar K <pkarampu@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9842
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2015-03-10 07:48:12 -07:00

17 lines
435 B
Bash
Executable File

#!/bin/bash
#
# Use this script to identify the command and line-number of test-cases.
#
if [ -z "${1}" -a -z "${2}" ]
then
echo "Usage: ${0} path/to/test/case.t testnumber"
exit 1
elif [ -z "${2}" ]
then
echo "ERROR: The second parameter to ${0} should be a number."
exit 2
fi
awk '{print FNR " " $0}' ${1} | egrep '^[[:digit:]]+[[:space:]]*(EXPECT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)' | sed -n ${2}p