commit bd85d3d03615bce543475e179c7acaf974863c51 from: Sergey Bronnikov date: Tue Nov 5 14:22:10 2024 UTC Introduce an option to control bank model The patch introduces an option `--allow-negative-balances` (short `-n`). The option is suitable for a bank model only. commit - 357a768cc7b521f551dfba795511c03c45ca6d5c commit + bd85d3d03615bce543475e179c7acaf974863c51 blob - 4ab2b6a222e43d9b53f1370c17246ad4c5f87747 blob + 3f7ace2d12c77f29274c9c995b07cad51f065eec --- CHANGELOG.md +++ CHANGELOG.md @@ -10,6 +10,8 @@ change log follows the conventions of ### Added +- An option `--allow-negative-balances`. + ### Fixed - A `set` checker (#44). blob - 01208537ac3d86e79e710b0b91e85ba1b4ff747d blob + 2ce178d9cebdc91b21f64d0d4c284f0635aa9725 --- src/elle_cli/cli.clj +++ src/elle_cli/cli.clj @@ -142,6 +142,9 @@ "(Jepsen) A group size." :default 0 :parse-fn #(Integer/parseInt %)] + ["-n" "--allow-negative-balances" + "(Jepsen) Allow negative balances in a bank model." + :default false] ; Knossos-specific options. ; None. @@ -184,7 +187,9 @@ "sequential" ((checker-fn) (history/parse-ops history)) "list-append" (checker-fn options history) "rw-register" (checker-fn options history) - "bank" (jepsen-model/check-safe (checker-fn {:negative-balances? true}) nil history) + "bank" (jepsen-model/check-safe (checker-fn + {:negative-balances? (get options :allow-negative-balances)}) + nil history) "counter" (jepsen-model/check-safe (checker-fn) nil history) "set" (jepsen-model/check-safe (checker-fn) nil history) "set-full" (jepsen-model/check-safe (checker-fn) nil history)