forked from openmessaging/dledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE openmessaging#296] Support Jepsen test based on Register-Model (…
…openmessaging#297) * feat(test): add jepsen test 1. add jepsen test Closes openmessaging#296 * feat(test): add arguments to pass in the user's name and password 1. add arguments to pass in the user's name and password Closes openmessaging#296 * build(test): add more git ignore entries 1. add more git ignore entries Closes openmessaging#296 * feat(example): add argument for read mode 1. add argument for read mode Closes openmessaging#296
- Loading branch information
1 parent
d1e080e
commit 786c7c7
Showing
15 changed files
with
489 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ devenv | |
!NOTICE-BIN | ||
!LICENSE-BIN | ||
.DS_Store | ||
nohup.out | ||
nohup.out | ||
*.gz | ||
dledger-example.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# build dledger | ||
cd ../; | ||
mvn clean install -DskipTests; | ||
mv example/target/dledger-example.jar jepsen/node-deploy/; | ||
rm jepsen/dledger-jepsen.tar.gz; | ||
chmod +x jepsen/node-deploy/startup.sh; | ||
chmod +x jepsen/node-deploy/stop.sh; | ||
chmod +x jepsen/node-deploy/stop_dropcaches.sh; | ||
tar zcvf jepsen/dledger-jepsen-node.tar.gz jepsen/node-deploy/dledger-example.jar jepsen/node-deploy/startup.sh jepsen/node-deploy/stop.sh jepsen/node-deploy/stop_dropcaches.sh; | ||
|
||
# build jepsen test | ||
cd jepsen; | ||
lein uberjar; | ||
chmod +x jepsen.sh; | ||
cd ../; | ||
tar zcvf jepsen/dledger-jepsen-control.tar.gz jepsen/jepsen.sh jepsen/nodes jepsen/target/openmessaging-dledger-jepsen-exec.jar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
sh ./build.sh ; | ||
control run dledger-control control-deploy; | ||
control run dledger-node node-deploy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
; Licensed to the Apache Software Foundation (ASF) under one or more | ||
; contributor license agreements. See the NOTICE file distributed with | ||
; this work for additional information regarding copyright ownership. | ||
; The ASF licenses this file to You under the Apache License, Version 2.0 | ||
; (the "License"); you may not use this file except in compliance with | ||
; the License. You may obtain a copy of the License at | ||
; | ||
; http://www.apache.org/licenses/LICENSE-2.0 | ||
; | ||
; Unless required by applicable law or agreed to in writing, software | ||
; distributed under the License is distributed on an "AS IS" BASIS, | ||
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
; See the License for the specific language governing permissions and | ||
; limitations under the License. | ||
|
||
|
||
(defcluster :dledger-node | ||
:clients [{:host "n0" :user "root"} | ||
{:host "n1" :user "root"} | ||
{:host "n2" :user "root"} | ||
{:host "n3" :user "root"} | ||
{:host "n4" :user "root"}]) | ||
|
||
(defcluster :dledger-control | ||
:clients [{:host "n5" :user "root"}]) | ||
|
||
(deftask :date "echo date on cluster" [] | ||
(ssh "date")) | ||
|
||
(deftask :node-deploy [] | ||
(ssh | ||
(run | ||
(cd "~" | ||
(run "rm -rf jepsen/") | ||
(run "rm -rf dledger-jepsen-node.tar.gz")))) | ||
(scp "dledger-jepsen-node.tar.gz" "~/") | ||
(ssh | ||
(run | ||
(cd "~" | ||
(run "tar zxvf dledger-jepsen-node.tar.gz") | ||
(run "rm -rf dledger-jepsen-node.tar.gz"))))) | ||
|
||
(deftask :control-deploy [] | ||
(ssh | ||
(run | ||
(cd "~" | ||
(run "rm -rf jepsen/") | ||
(run "rm -rf dledger-jepsen-control.tar.gz")))) | ||
(scp "dledger-jepsen-control.tar.gz" "~/") | ||
(ssh | ||
(run | ||
(cd "~" | ||
(run "tar zxvf dledger-jepsen-control.tar.gz") | ||
(run "rm -rf dledger-jepsen-control.tar.gz"))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
java -jar target/openmessaging-dledger-jepsen-exec.jar test $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
nohup java -jar ./dledger-example.jar register $@ >> register-dledger.log 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
pid=`ps -ef |grep dledger-example |grep java |awk -F' ' '{print $2}'` | ||
if [ "$pid" != "" ] | ||
then | ||
echo "kill $pid" | ||
kill $pid | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
pid=`ps -ef |grep dledger-example |grep java |awk -F' ' '{print $2}'` | ||
if [ "$pid" != "" ] | ||
then | ||
echo "kill $pid" | ||
kill $pid | ||
fi | ||
|
||
# To free pagecache, dentries and inodes | ||
echo 3 >/proc/sys/vm/drop_caches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
n0 | ||
n1 | ||
n2 | ||
n3 | ||
n4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; Licensed to the Apache Software Foundation (ASF) under one or more | ||
; contributor license agreements. See the NOTICE file distributed with | ||
; this work for additional information regarding copyright ownership. | ||
; The ASF licenses this file to You under the Apache License, Version 2.0 | ||
; (the "License"); you may not use this file except in compliance with | ||
; the License. You may obtain a copy of the License at | ||
; | ||
; http://www.apache.org/licenses/LICENSE-2.0 | ||
; | ||
; Unless required by applicable law or agreed to in writing, software | ||
; distributed under the License is distributed on an "AS IS" BASIS, | ||
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
; See the License for the specific language governing permissions and | ||
; limitations under the License. | ||
|
||
|
||
(defproject openmessaging-dledger-jepsen "0.0.1-SNAPSHOT" | ||
:descritopn "A jepsen test for DLedger" | ||
:license {:name "Apache License 2.0"} | ||
:main io.openmessaging.storage.dledger.jepsen.core | ||
:dependencies [[org.clojure/clojure "1.10.0"] | ||
[jepsen "0.1.15-SNAPSHOT"] | ||
[io.openmessaging.storage/dledger-example "0.3.3-SNAPSHOT"]] | ||
:aot [io.openmessaging.storage.dledger.jepsen.core] | ||
:source-paths ["src" "src/main/clojure"] | ||
:jar-name "openmessaging-dledger-jepsen.jar" | ||
:uberjar-name "openmessaging-dledger-jepsen-exec.jar") |
Oops, something went wrong.