From af840738f2444c970201afbf4a8a8bed273e1e3d Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 12 Sep 2022 16:40:41 +0100 Subject: [PATCH] sidelaod() --- san | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/san b/san index f5cd321..062ba30 100644 --- a/san +++ b/san @@ -253,6 +253,49 @@ tail_dmesg() done } +###############################################################################v +# Tools +# +header "Tools" + +descr " zms_client {} " +zms_client() +{ + if [ "$1" == "" -o "$1" == "help" ]; then + echo "zms_client {}" + return + fi + local MSG="{ \"action\":\"$1\"," + + [ "$2" != "" ] && MSG="$MSG \"mount\":\"$2\", " + [ "$3" != "" ] && MSG="$MSG \"file\":\"$3\", " + [ "$4" != "" ] && MSG="$MSG \"swapto\":\"$4\", " + + MSG="$MSG \"type\":\"zip\", \"uid\":501, \"gid\":501, \"flags\":0 }" + + set -x + plethora msg-send /zip-client "$MSG" + plethora msg-receive /zip-server + set +x +} + +zms_hotswap_stress_test() +{ + local PLUGIN="/nvram/plugins/$1.zip" + local PLUGIN_COPY="/tmp/$1.zip" + cp $PLUGIN $PLUGIN_COPY + + # local MPOINT=$(zms_client query $PLUGIN | sed -e 's/^.*"mount":"\([^"]*\)".*$/\1/') + local MPOINT=/tmp/hotswap_test + mkdir $MPOINT + zms_client mount "$MPOINT" "$PLUGIN_COPY" "$PLUGIN" + while true; do + zms_client hotswap "$MPOINT" "$PLUGIN" "$PLUGIN_COPY" + zms_client hotswap "$MPOINT" "$PLUGIN_COPY" "$PLUGIN" + done +} + + ################################################################################ # # Log @@ -427,6 +470,13 @@ setup_plugfest() } +################################################################################ +# +# bug reproduce +# + + + ################################################################################ # # Done