Skip to content

Commit

Permalink
cfm: Remove tabs from output.
Browse files Browse the repository at this point in the history
OVS uses spaces for indentation in source code and it makes sense for it to
also use spaces for indentation in output.  Spaces also consume less
horizontal space in output, which often makes it easier to read.  This
commit transitions one part of output from tabs to spaces and updates
appropriate parts of the tests to match.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
  • Loading branch information
blp committed Jun 11, 2018
1 parent fc002ed commit f6d6edc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
20 changes: 10 additions & 10 deletions lib/cfm.c
Expand Up @@ -1032,30 +1032,30 @@ cfm_print_details(struct ds *ds, struct cfm *cfm) OVS_REQUIRES(mutex)

fault = cfm_get_fault__(cfm);
if (fault) {
ds_put_cstr(ds, "\tfault: ");
ds_put_cstr(ds, " fault: ");
ds_put_cfm_fault(ds, fault);
ds_put_cstr(ds, "\n");
}

if (cfm->health == -1) {
ds_put_format(ds, "\taverage health: undefined\n");
ds_put_format(ds, " average health: undefined\n");
} else {
ds_put_format(ds, "\taverage health: %d\n", cfm->health);
ds_put_format(ds, " average health: %d\n", cfm->health);
}
ds_put_format(ds, "\topstate: %s\n", cfm->opup ? "up" : "down");
ds_put_format(ds, "\tremote_opstate: %s\n",
ds_put_format(ds, " opstate: %s\n", cfm->opup ? "up" : "down");
ds_put_format(ds, " remote_opstate: %s\n",
cfm->remote_opup ? "up" : "down");
ds_put_format(ds, "\tinterval: %dms\n", cfm->ccm_interval_ms);
ds_put_format(ds, "\tnext CCM tx: %lldms\n",
ds_put_format(ds, " interval: %dms\n", cfm->ccm_interval_ms);
ds_put_format(ds, " next CCM tx: %lldms\n",
timer_msecs_until_expired(&cfm->tx_timer));
ds_put_format(ds, "\tnext fault check: %lldms\n",
ds_put_format(ds, " next fault check: %lldms\n",
timer_msecs_until_expired(&cfm->fault_timer));

HMAP_FOR_EACH (rmp, node, &cfm->remote_mps) {
ds_put_format(ds, "Remote MPID %"PRIu64"\n", rmp->mpid);
ds_put_format(ds, "\trecv since check: %s\n",
ds_put_format(ds, " recv since check: %s\n",
rmp->recv ? "true" : "false");
ds_put_format(ds, "\topstate: %s\n", rmp->opup? "up" : "down");
ds_put_format(ds, " opstate: %s\n", rmp->opup? "up" : "down");
}
}

Expand Down
20 changes: 10 additions & 10 deletions tests/cfm.at
Expand Up @@ -5,12 +5,12 @@ AT_CHECK([ovs-appctl cfm/show $1 | sed -e '/next CCM tx:/d' | sed -e '/next faul
[dnl
---- $1 ----
MPID $2: extended
average health: $3
opstate: $4
remote_opstate: $5
interval: $6
average health: $3
opstate: $4
remote_opstate: $5
interval: $6
Remote MPID $7
opstate: $8
opstate: $8
])
])

Expand All @@ -19,11 +19,11 @@ AT_CHECK([ovs-appctl cfm/show $1 | sed -e '/next CCM tx:/d' | sed -e '/next faul
[dnl
---- $1 ----
MPID $2: extended
fault: $3
average health: $4
opstate: $5
remote_opstate: $6
interval: $7
fault: $3
average health: $4
opstate: $5
remote_opstate: $6
interval: $7
])
])

Expand Down
6 changes: 3 additions & 3 deletions tests/ofproto-dpif.at
Expand Up @@ -8590,7 +8590,7 @@ ovs-appctl time/stop
ovs-appctl time/warp 5000 100
# cfm/show should show 'recv' fault.
AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
fault: recv
fault: recv
])
# bfd/show should show 'up'.
AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
Expand All @@ -8613,7 +8613,7 @@ AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
ovs-appctl time/warp 5000 100
# cfm/show should show 'recv' fault.
AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
fault: recv
fault: recv
])
# bfd/show should show 'down'.
AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
Expand All @@ -8633,7 +8633,7 @@ AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
ovs-appctl time/warp 5000 100
# cfm/show should show 'recv' fault.
AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
fault: recv
fault: recv
])
# bfd/show should show 'down'.
AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
Expand Down

0 comments on commit f6d6edc

Please sign in to comment.