Skip to content

Commit

Permalink
Rename options with model's names
Browse files Browse the repository at this point in the history
Closes #38
  • Loading branch information
ligurio committed Apr 29, 2022
1 parent ddf8032 commit 98ebc90
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 51 deletions.
48 changes: 29 additions & 19 deletions src/elle_cli/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
64 changes: 32 additions & 32 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 98ebc90

Please sign in to comment.