Skip to content

Commit

Permalink
Introduce an option to control bank model
Browse files Browse the repository at this point in the history
The patch introduces an option `--allow-negative-balances`
(short `-n`). The option is suitable for a bank model only.
  • Loading branch information
ligurio committed Nov 5, 2024
1 parent 357a768 commit bd85d3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ change log follows the conventions of

### Added

- An option `--allow-negative-balances`.

### Fixed

- A `set` checker (#44).
Expand Down
7 changes: 6 additions & 1 deletion src/elle_cli/cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bd85d3d

Please sign in to comment.