LASSERT(lsmp);
lsm = *lsmp;
LASSERT(lsm);
- LASSERT(ostid_id(&lsm->lsm_oi) != 0);
- LASSERT(ostid_seq(&lsm->lsm_oi) == FID_SEQ_ECHO);
+ LASSERTF(ostid_id(&lsm->lsm_oi) != 0, DOSTID"\n", POSTID(&lsm->lsm_oi));
+ LASSERTF(ostid_seq(&lsm->lsm_oi) == FID_SEQ_ECHO, DOSTID"\n",
+ POSTID(&lsm->lsm_oi));
/* Never return an object if the obd is to be freed. */
if (echo_dev2cl(d)->cd_lu_dev.ld_obd->obd_stopping)
return 0
}
-obdecho_create_test() {
+obdecho_test() {
local OBD=$1
local node=$2
local rc=0
[ ${PIPESTATUS[0]} -eq 0 -a -n "$id" ] || rc=3
fi
echo "New object id is $id"
- [ $rc -eq 0 ] && { do_facet $node "$LCTL --device ec test_brw 10 w v 64 $id" ||
- rc=4; }
- [ $rc -eq 0 -o $rc -gt 2 ] && { do_facet $node "$LCTL --device ec " \
+ [ $rc -eq 0 ] && { do_facet $node "$LCTL --device ec getattr $id" ||
+ rc=4; }
+ [ $rc -eq 0 ] && { do_facet $node "$LCTL --device ec test_brw 10 w v 64 $id" ||
+ rc=4; }
+ [ $rc -eq 0 ] && { do_facet $node "$LCTL --device ec destroy $id 1" ||
+ rc=4; }
+ [ $rc -eq 0 -o $rc -gt 2 ] && { do_facet $node "$LCTL --device ec " \
"cleanup" || rc=5; }
[ $rc -eq 0 -o $rc -gt 1 ] && { do_facet $node "$LCTL --device ec " \
"detach" || rc=6; }
test_180a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- remote_ost_nodsh && skip "remote OST with nodsh" && return
- local rc=0
- local rmmod_local=0
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+ local rc=0
+ local rmmod_local=0
- if ! module_loaded obdecho; then
- load_module obdecho/obdecho
- rmmod_local=1
- fi
+ if ! module_loaded obdecho; then
+ load_module obdecho/obdecho
+ rmmod_local=1
+ fi
- local osc=$($LCTL dl | grep -v mdt | awk '$3 == "osc" {print $4; exit}')
- local host=$(lctl get_param -n osc.$osc.import |
- awk '/current_connection:/ {print $2}' )
- local target=$(lctl get_param -n osc.$osc.import |
- awk '/target:/ {print $2}' )
- target=${target%_UUID}
-
- [[ -n $target ]] && { setup_obdecho_osc $host $target || rc=1; } || rc=1
- [ $rc -eq 0 ] && { obdecho_create_test ${target}_osc client || rc=2; }
- [[ -n $target ]] && cleanup_obdecho_osc $target
- [ $rmmod_local -eq 1 ] && rmmod obdecho
- return $rc
+ local osc=$($LCTL dl | grep -v mdt | awk '$3 == "osc" {print $4; exit}')
+ local host=$(lctl get_param -n osc.$osc.import |
+ awk '/current_connection:/ {print $2}' )
+ local target=$(lctl get_param -n osc.$osc.import |
+ awk '/target:/ {print $2}' )
+ target=${target%_UUID}
+
+ [[ -n $target ]] && { setup_obdecho_osc $host $target || rc=1; } || rc=1
+ [ $rc -eq 0 ] && { obdecho_test ${target}_osc client || rc=2; }
+ [[ -n $target ]] && cleanup_obdecho_osc $target
+ [ $rmmod_local -eq 1 ] && rmmod obdecho
+ return $rc
}
run_test 180a "test obdecho on osc"
test_180b() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- remote_ost_nodsh && skip "remote OST with nodsh" && return
- local rc=0
- local rmmod_remote=0
-
- do_facet ost1 "lsmod | grep -q obdecho || " \
- "{ insmod ${LUSTRE}/obdecho/obdecho.ko || " \
- "modprobe obdecho; }" && rmmod_remote=1
- target=$(do_facet ost1 $LCTL dl | awk '/obdfilter/ {print $4;exit}')
- [[ -n $target ]] && { obdecho_create_test $target ost1 || rc=1; }
- [ $rmmod_remote -eq 1 ] && do_facet ost1 "rmmod obdecho"
- return $rc
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+ local rc=0
+ local rmmod_remote=0
+
+ do_facet ost1 "lsmod | grep -q obdecho || " \
+ "{ insmod ${LUSTRE}/obdecho/obdecho.ko || " \
+ "modprobe obdecho; }" && rmmod_remote=1
+ target=$(do_facet ost1 $LCTL dl | awk '/obdfilter/ {print $4;exit}')
+ [[ -n $target ]] && { obdecho_test $target ost1 || rc=1; }
+ [ $rmmod_remote -eq 1 ] && do_facet ost1 "rmmod obdecho"
+ return $rc
}
run_test 180b "test obdecho directly on obdfilter"
gettimeofday(&next_time, NULL);
next_time.tv_sec -= verbose;
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
data.ioc_obdo1.o_mode = mode;
- ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
ostid_set_id(&data.ioc_obdo1.o_oi, base_id);
data.ioc_obdo1.o_uid = 0;
data.ioc_obdo1.o_gid = 0;
if (argc != 2)
return CMD_HELP;
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
ostid_set_id(&data.ioc_obdo1.o_oi, strtoull(argv[1], &end, 0));
if (*end) {
fprintf(stderr, "error: %s: invalid objid '%s'\n",
printf("%s: setting "LPD64" attrs (objid "LPX64"): %s",
jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
ostid_set_id(&data.ioc_obdo1.o_oi, objid);
data.ioc_obdo1.o_mode = S_IFREG;
gettimeofday(&next_time, NULL);
next_time.tv_sec -= verbose;
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++, id++) {
ostid_set_id(&data.ioc_obdo1.o_oi, id);
data.ioc_obdo1.o_mode = S_IFREG | 0644;
memset(&data, 0, sizeof(data));
data.ioc_dev = cur_device;
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
ostid_set_id(&data.ioc_obdo1.o_oi, strtoull(argv[1], &end, 0));
if (*end) {
fprintf(stderr, "error: %s: invalid objid '%s'\n",
printf("%s: getting "LPD64" attrs (objid "LPX64"): %s",
jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
+ ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
ostid_set_id(&data.ioc_obdo1.o_oi, objid);
data.ioc_obdo1.o_mode = S_IFREG;