From 98ebc90214ab884705eac6badbe753aa990693ac Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Fri, 29 Apr 2022 15:19:18 +0300 Subject: [PATCH] Rename options with model's names Closes #38 --- src/elle_cli/cli.clj | 48 ++++++++++++++++++++------------- test.sh | 64 ++++++++++++++++++++++---------------------- 2 files changed, 61 insertions(+), 51 deletions(-) diff --git a/src/elle_cli/cli.clj b/src/elle_cli/cli.clj index 196c675..e424ad0 100644 --- a/src/elle_cli/cli.clj +++ b/src/elle_cli/cli.clj @@ -68,16 +68,16 @@ (mapv keyword (str/split s #",")))) (def models - {"knossos-register" knossos-model/register - "knossos-cas-register" knossos-model/cas-register - "knossos-mutex" knossos-model/mutex - "jepsen-bank" jepsen-bank/checker - "jepsen-long-fork" jepsen-long-fork/checker - "jepsen-counter" jepsen-model/counter - "jepsen-set" jepsen-model/set - "jepsen-set-full" jepsen-model/set-full - "elle-rw-register" elle-rw-register/check - "elle-list-append" elle-list-append/check}) + {"register" knossos-model/register + "cas-register" knossos-model/cas-register + "mutex" knossos-model/mutex + "bank" jepsen-bank/checker + "long-fork" jepsen-long-fork/checker + "counter" jepsen-model/counter + "set" jepsen-model/set + "set-full" jepsen-model/set-full + "rw-register" elle-rw-register/check + "list-append" elle-list-append/check}) (def history-read-fn {"edn" read-edn-history @@ -143,15 +143,15 @@ "Usage: elle-cli -m model [options] files" "" "Supported models:" - " elle-rw-register - an Elle's checker for write-read registers." - " elle-list-append - an Elle's checker for append and read histories." - " jepsen-bank - a Jepsen's checker for bank histories." - " jepsen-counter - a Jepsen's checker for counter histories." - " jepsen-set - a Jepsen's checker for a set histories." - " jepsen-set-full - a Jepsen's checker for a set histories." - " jepsen-long-fork - a Jepsen's checker for an anomaly in parallel snapshot isolation." - " knossos-cas-register - a Knossos checker for CAS (Compare-And-Set) registers." - " knossos-mutex - a Knossos checker for a mutex histories." + " rw-register - an checker for write-read registers." + " list-append - an checker for append and read histories." + " bank - a checker for bank histories." + " counter - a checker for counter histories." + " set - a checker for a set histories." + " set-full - a checker for a set histories." + " long-fork - a checker for an anomaly in parallel snapshot isolation." + " cas-register - a checker for CAS (Compare-And-Set) registers." + " mutex - a checker for a mutex histories." "" "Options:" options-summary @@ -165,17 +165,27 @@ (let [checker-fn (get models model-name)] (case model-name ; Normalize ops for Knossos, see src/knossos/cli.clj:read-history. + "register" (competition/analysis (checker-fn) (history/parse-ops history)) "knossos-register" (competition/analysis (checker-fn) (history/parse-ops history)) ; Normalize ops for Knossos, see src/knossos/cli.clj:read-history. + "cas-register" (competition/analysis (checker-fn) (history/parse-ops history)) "knossos-cas-register" (competition/analysis (checker-fn) (history/parse-ops history)) ; Normalize ops for Knossos, see src/knossos/cli.clj:read-history. + "mutex" (competition/analysis (checker-fn) (history/parse-ops history)) "knossos-mutex" (competition/analysis (checker-fn) (history/parse-ops history)) + "list-append" (checker-fn options history) "elle-list-append" (checker-fn options history) + "rw-register" (checker-fn options history) "elle-rw-register" (checker-fn options history) + "bank" (jepsen-model/check-safe (checker-fn {:negative-balances? true}) nil history) "jepsen-bank" (jepsen-model/check-safe (checker-fn {:negative-balances? true}) nil history) + "counter" (jepsen-model/check-safe (checker-fn) nil history) "jepsen-counter" (jepsen-model/check-safe (checker-fn) nil history) + "long-fork" (jepsen-model/check-safe (checker-fn) nil history) "jepsen-long-fork" (jepsen-model/check-safe (checker-fn) nil history) + "set" (jepsen-model/check-safe (checker-fn) nil history) "jepsen-set" (jepsen-model/check-safe (checker-fn) nil history) + "set-full" (jepsen-model/check-safe (checker-fn) nil history) "jepsen-set-full" (jepsen-model/check-safe (checker-fn) nil history)))) (defn read-fn-by-extension diff --git a/test.sh b/test.sh index 4aa84cf..bfe6142 100755 --- a/test.sh +++ b/test.sh @@ -6,35 +6,35 @@ ELLE_CLI_VERSION="0.1.2" ELLE_CLI_BIN="java -jar target/elle-cli-${ELLE_CLI_VERSION}-standalone.jar" ELLE_CLI_OPT="--model" -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/bad-analysis.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/cas-failure.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/mongodb-v0-ack-rollback-6.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/rethink-fail.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/rethink-fail-minimal.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/bad/rethink-fail-smaller.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/good/memstress3-9.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-cas-register histories/knossos/cas-register/good/memstress3-9.json - -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-mutex histories/knossos/mutex/bad/etcd.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-mutex histories/knossos/mutex/bad/etcd.json -$ELLE_CLI_BIN $ELLE_CLI_OPT knossos-mutex histories/knossos/mutex/bad/hazelcast.edn - -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-rw-register histories/elle/rw-register.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-rw-register histories/elle/rw-register.json -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json --plot-format svg -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json --anomalies G-single-process --consistency-models '' -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json --cycle-search-timeout 1000 -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json --plot-timeout 5000 -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/paper-example.json --max-plot-bytes 65536 -$ELLE_CLI_BIN $ELLE_CLI_OPT elle-list-append histories/elle/list-append-gh-30.edn --consistency-models serializable - -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-counter histories/jepsen/counter.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-counter histories/jepsen/counter.json - -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-set-full histories/jepsen/set_full.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-set-full histories/jepsen/set_full.json - -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-bank histories/jepsen/bank.edn -$ELLE_CLI_BIN $ELLE_CLI_OPT jepsen-bank histories/jepsen/bank.json +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/bad-analysis.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/cas-failure.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/mongodb-v0-ack-rollback-6.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/rethink-fail.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/rethink-fail-minimal.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/bad/rethink-fail-smaller.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/good/memstress3-9.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT cas-register histories/knossos/cas-register/good/memstress3-9.json + +$ELLE_CLI_BIN $ELLE_CLI_OPT mutex histories/knossos/mutex/bad/etcd.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT mutex histories/knossos/mutex/bad/etcd.json +$ELLE_CLI_BIN $ELLE_CLI_OPT mutex histories/knossos/mutex/bad/hazelcast.edn + +$ELLE_CLI_BIN $ELLE_CLI_OPT rw-register histories/elle/rw-register.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT rw-register histories/elle/rw-register.json +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json --plot-format svg +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json --anomalies G-single-process --consistency-models '' +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json --cycle-search-timeout 1000 +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json --plot-timeout 5000 +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/paper-example.json --max-plot-bytes 65536 +$ELLE_CLI_BIN $ELLE_CLI_OPT list-append histories/elle/list-append-gh-30.edn --consistency-models serializable + +$ELLE_CLI_BIN $ELLE_CLI_OPT counter histories/jepsen/counter.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT counter histories/jepsen/counter.json + +$ELLE_CLI_BIN $ELLE_CLI_OPT set-full histories/jepsen/set_full.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT set-full histories/jepsen/set_full.json + +$ELLE_CLI_BIN $ELLE_CLI_OPT bank histories/jepsen/bank.edn +$ELLE_CLI_BIN $ELLE_CLI_OPT bank histories/jepsen/bank.json