Jepsen testing (NLnet task 3 subtask 1) #544

Merged
lx merged 41 commits from jepsen into main 2024-01-11 10:52:13 +00:00
2 changed files with 10 additions and 6 deletions
Showing only changes of commit ef5ca86dfc - Show all commits

View file

@ -42,7 +42,7 @@
(let [workload ((get workloads (:workload opts)) opts) (let [workload ((get workloads (:workload opts)) opts)
garage-version (if (:increasing-timestamps opts) garage-version (if (:increasing-timestamps opts)
"03490d41d58576d7b3bcf977b2726d72a3a66ada" "03490d41d58576d7b3bcf977b2726d72a3a66ada"
"v0.8.2")] "v0.9.0")]
(merge tests/noop-test (merge tests/noop-test
opts opts
{:pure-generators true {:pure-generators true

View file

@ -9,6 +9,8 @@
; CONSTANTS -- HOW GARAGE IS SET UP ; CONSTANTS -- HOW GARAGE IS SET UP
(def dir "/opt/garage") (def dir "/opt/garage")
(def data-dir (str dir "/data"))
(def meta-dir (str dir "/meta"))
(def binary (str dir "/garage")) (def binary (str dir "/garage"))
(def logfile (str dir "/garage.log")) (def logfile (str dir "/garage.log"))
(def pidfile (str dir "/garage.pid")) (def pidfile (str dir "/garage.pid"))
@ -54,18 +56,19 @@
:chdir dir} :chdir dir}
binary binary
:server) :server)
(Thread/sleep 100) (info node "garage daemon started")
(c/exec :sleep 5)
(let [node-id (c/exec binary :node :id :-q)] (let [node-id (c/exec binary :node :id :-q)]
(info node "node id:" node-id) (info node "node id:" node-id)
(c/on-many (:nodes test) (c/on-many (:nodes test)
(c/exec binary :node :connect node-id)) (c/exec binary :node :connect node-id))
(c/exec binary :layout :assign (subs node-id 0 16) :-c 1 :-z :dc1 :-t node)) (c/exec binary :layout :assign (subs node-id 0 16) :-c :1G :-z :dc1 :-t node))
(if (= node (first (:nodes test))) (if (= node (first (:nodes test)))
(do (do
(Thread/sleep 2000) (c/exec :sleep 5)
(c/exec binary :layout :apply :--version 1) (c/exec binary :layout :apply :--version 1)
(info node "garage status:" (c/exec binary :status)) (info node "garage status:" (c/exec binary :status))
(c/exec binary :key :new :--name grg-key) (c/exec binary :key :create grg-key)
(c/exec binary :bucket :create grg-bucket) (c/exec binary :bucket :create grg-bucket)
(c/exec binary :bucket :allow :--read :--write grg-bucket :--key grg-key) (c/exec binary :bucket :allow :--read :--write grg-bucket :--key grg-key)
(info node "key info: " (c/exec binary :key :info grg-key)))))) (info node "key info: " (c/exec binary :key :info grg-key))))))
@ -73,7 +76,8 @@
(info node "tearing down garage" version) (info node "tearing down garage" version)
(c/su (c/su
(cu/stop-daemon! binary pidfile) (cu/stop-daemon! binary pidfile)
(c/exec :rm :-rf dir))) (c/exec :rm :-rf data-dir)
(c/exec :rm :-rf meta-dir)))
db/LogFiles db/LogFiles
(log-files [_ test node] (log-files [_ test node]
[logfile]))) [logfile])))