|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +test_description='Test flux module trace' |
| 4 | + |
| 5 | +. $(dirname $0)/sharness.sh |
| 6 | + |
| 7 | +test_under_flux 1 |
| 8 | + |
| 9 | +waitfile="${SHARNESS_TEST_SRCDIR}/scripts/waitfile.lua" |
| 10 | + |
| 11 | +test_expect_success 'flux module trace fails with missing module name' ' |
| 12 | + test_must_fail flux module trace |
| 13 | +' |
| 14 | +test_expect_success 'flux module trace fails with unknown argument' ' |
| 15 | + test_must_fail flux module trace --not-an-arg |
| 16 | +' |
| 17 | +test_expect_success 'flux module trace fails with wrong message type' ' |
| 18 | + test_must_fail flux module trace -t foo,bar |
| 19 | +' |
| 20 | +test_expect_success 'reload heartbeat with increased heart rate' ' |
| 21 | + flux module reload heartbeat period=0.2s |
| 22 | +' |
| 23 | +test_expect_success NO_CHAIN_LINT 'start background trace' ' |
| 24 | + flux module trace kvs >trace.out & |
| 25 | + echo $! >trace.pid |
| 26 | +' |
| 27 | +test_expect_success NO_CHAIN_LINT 'heartbeat.pulse event was captured' ' |
| 28 | + $waitfile -t 60 -p heartbeat.pulse trace.out |
| 29 | +' |
| 30 | +test_expect_success NO_CHAIN_LINT 'send one kvs.ping' ' |
| 31 | + flux ping -c 1 kvs |
| 32 | +' |
| 33 | +test_expect_success NO_CHAIN_LINT 'kvs.ping request/response was captured' ' |
| 34 | + $waitfile -t 60 -c 2 -p kvs.ping trace.out |
| 35 | +' |
| 36 | +test_expect_success NO_CHAIN_LINT 'stop background trace' ' |
| 37 | + kill -15 $(cat trace.pid); wait || true |
| 38 | +' |
| 39 | + |
| 40 | +test_expect_success NO_CHAIN_LINT 'start background trace on multiple modules' ' |
| 41 | + flux module trace kvs barrier >trace2.out & |
| 42 | + echo $! >trace2.pid |
| 43 | +' |
| 44 | +test_expect_success NO_CHAIN_LINT 'heartbeat.pulse event was captured' ' |
| 45 | + $waitfile -t 60 -p heartbeat.pulse trace2.out |
| 46 | +' |
| 47 | +test_expect_success NO_CHAIN_LINT 'send one barrier.ping' ' |
| 48 | + flux ping -c 1 barrier |
| 49 | +' |
| 50 | +test_expect_success NO_CHAIN_LINT 'barrier.ping request/response was captured' ' |
| 51 | + $waitfile -t 60 -c 2 -p barrier.ping trace2.out |
| 52 | +' |
| 53 | +test_expect_success NO_CHAIN_LINT 'stop background trace' ' |
| 54 | + kill -15 $(cat trace2.pid); wait || true |
| 55 | +' |
| 56 | +test_done |
0 commit comments