Instead of writing the CLI calls to stderr as INFO loglines, now add them to a list of messages by prune/create/sync. Always close the VPP connection after finishing, by adding a destructor to the VPPApi class. At the end of each phase, print out what was gathered to stdout. Later, I will make this more advanced (output to file, output directly to a pipe of a running vppctl binary, etc).
22 lines
666 B
Bash
Executable File
22 lines
666 B
Bash
Executable File
#!/bin/sh
|
|
|
|
for i in hippo[0-9]*.yaml; do
|
|
echo "Clearing: Moving to hippo-empty.yaml"
|
|
./vppcfg -c hippo-empty.yaml > /tmp/vppcfg-exec-empty
|
|
[ -s /tmp/vppcfg-exec-empty ] && vppctl exec /tmp/vppcfg-exec-empty
|
|
|
|
for j in hippo[0-9]*.yaml; do
|
|
echo " - Moving to $i .. "
|
|
./vppcfg -c $i > /tmp/vppcfg-exec_$i
|
|
[ -s /tmp/vppcfg-exec_$i ] && vppctl exec /tmp/vppcfg-exec_$i
|
|
|
|
echo " - Moving from $i to $j"
|
|
./vppcfg -c $j > /tmp/vppcfg-exec_${i}_${j}
|
|
[ -s /tmp/vppcfg-exec_${i}_${j} ] && vppctl exec /tmp/vppcfg-exec_${i}_${j}
|
|
|
|
echo " - Checking that from $j to $j is empty"
|
|
./vppcfg -c $j > /tmp/vppcfg-exec_${j}_${j}_null
|
|
done
|
|
|
|
done
|