diff options
| author | krad <krad@fb.com> | 2017-09-13 17:21:17 -0700 | 
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2017-09-15 17:58:08 +0000 | 
| commit | e4b47b5d54644c398c424a99116a0cc37e4431d6 (patch) | |
| tree | caf18964e48416ae593cda26b8a50441155eb0e4 /fb-remote-test.sh | |
| parent | 4d80fcf5ec2098aa4f5aef07dec80ec9eb5ad602 (diff) | |
fbsmoke: Sync with 3.6 functionality
Summary:
(1) Depricate REMOTE=1 fb-smoke.sh
(2) Add fb-remote-test.sh
(3) Add .arcconfig for arc smoke/test/asan-noleaks
(4) Minor fix to ASAN_ENABLED variable handling
Test Plan: Run tests manually
Differential Revision: https://phabricator.intern.facebook.com/D5830444
Change-Id: Ie8a427a11761ac5b23844b77b82b24269626d352
Reviewed-on: https://review.gluster.org/18290
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'fb-remote-test.sh')
| -rwxr-xr-x | fb-remote-test.sh | 93 | 
1 files changed, 93 insertions, 0 deletions
diff --git a/fb-remote-test.sh b/fb-remote-test.sh new file mode 100755 index 00000000000..38648d84fde --- /dev/null +++ b/fb-remote-test.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +source ./test_env + +FBCODE="$HOME/fbsource/fbcode" +N=0 +HOSTS=$(smcc ls-hosts -s gluster.build.ash gluster.build.prn | xargs) +TESTS=$DESIRED_TESTS +FLAKY=$KNOWN_FLAKY_TESTS + +FLAGS="" + +function print_env { +    echo "Settings:" +    echo "FBCODE=$FBCODE" +    echo "N=$N" +    echo -e "-------\nHOSTS\n$HOSTS\n-------" +    echo -e "TESTS\n$TESTS\n-------" +    echo -e "FLAKY\n$FLAKY\n-------" +} + +function cleanup { +    rm -f /tmp/test-*.log +} + +function usage { +    echo "Usage: $0 [-h or --help] [-v or --verbose] +             [--fbcode <fbcode root>] +             [--valgrind] [--asan] [--asan-noleaks] +             [--hosts <hosts>] [--smc-tier <tier name>] [-n <parallelism>] +             [--tests <tests>] [--flaky <tests>] +    " +} + +function tiers_to_hosts { +    hosts="" +    for t in $1; do +        hosts="$hosts $(smcc ls-hosts -s $t | xargs)" +    done +    echo $hosts +} + +function parse_args () { +    args=`getopt \ +            -o hvn: \ +            --long help,verbose,valgrind,asan,asan-noleaks,fbcode:,hosts:,smc-tier:,tests:,flaky: \ +            -n 'fb-remote-test.sh' --  "$@"` + +    if [ $? != 0 ]; then +        echo "Error parsing getopt" +        exit 1 +    fi + +    eval set -- "$args" + +    while true; do +        case "$1" in +            -h | --help) usage ; exit 1 ;; +            --fbcode) FBCODE=$2 ; shift 2 ;; +            -v | --verbose) FLAGS="$FLAGS -v" ; shift ;; +            --valgrind) FLAGS="$FLAGS --valgrind" ; shift ;; +            --asan-noleaks) FLAGS="$FLAGS --asan-noleaks"; shift ;; +            --asan) FLAGS="$FLAGS --asan" ; shift ;; +            --hosts) HOSTS=$2; shift 2 ;; +            --smc-tier) HOSTS=$(tiers_to_hosts $2) ; shift 2 ;; +            --tests) TESTS=$2; shift 2 ;; +            --flaky) FLAKY=$2; shift 2 ;; +            -n) N=$2; shift 2 ;; +            *) break ;; +            esac +        done +        run_tests_args="$@" +} + +function main { +    parse_args "$@" + +    if [ ! -d "$FBCODE" ]; then +        echo "fbcode does not exists. Please checkout fbcode" +        return 1 +    fi + +    print_env + +    cleanup + +    "$FBCODE/storage/gluster/gluster-build/fb-gluster-test.py" $FLAGS --tester \ +        --n "$N" --hosts "$HOSTS" --tests "$TESTS" --flaky_tests "$FLAKY" + +    exit $? +} + +main "$@"  | 
