Skip to content

Commit

Permalink
Add some scripts to use qed on development
Browse files Browse the repository at this point in the history
  • Loading branch information
gdiazlo committed Mar 19, 2019
1 parent 57b4e88 commit 11422e2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
10 changes: 10 additions & 0 deletions tests/gossip/getsnapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

raw=$(curl -s "http://localhost:8888/snapshot?v=$1")

history=$(echo $raw | jq -r '.Snapshot.HistoryDigest' | base64 -d | xxd -c64 -g64 | cut -f2 -d' ')
hyper=$(echo $raw | jq -r '.Snapshot.HyperDigest' | base64 -d | xxd -c64 -g64 | cut -f2 -d' ')

echo HyperDigest: $hyper
echo HistoryDigest: $history

10 changes: 10 additions & 0 deletions tests/gossip/membership.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash


go run $GOPATH/src/github.com/bbva/qed/main.go \
--apikey my-key \
client \
--log info \
--endpoints http://${QED_LEADER}:8800 \
membership --key key$1 \
--version $1 --verify
8 changes: 5 additions & 3 deletions tests/gossip/run_gossip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# Licensed 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.
Expand Down Expand Up @@ -35,19 +37,19 @@ sleep 2s

for i in `seq 1 $1`;
do
xterm -hold -e "$QED agent --alertsUrls $alertsStoreEndpoint auditor -k key -l debug --bind 127.0.0.1:810$i --join $qedGossipEndpoint --qedUrls $qedHTTPEndpoint --pubUrls $snapshotStoreEndpoint --node auditor$i" &
xterm -hold -e "$QED agent --metrics 127.0.0.2:1810$i auditor -k key -l debug --bind 127.0.0.1:810$i --join $qedGossipEndpoint --qedUrls $qedHTTPEndpoint --pubUrls $snapshotStoreEndpoint --node auditor$i --alertsUrls $alertsStoreEndpoint" &
pids+=($!)
done

for i in `seq 1 $2`;
do
xterm -hold -e "$QED agent --alertsUrls $alertsStoreEndpoint monitor -k key -l debug --bind 127.0.0.1:820$i --join $qedGossipEndpoint --qedUrls $qedHTTPEndpoint --pubUrls $snapshotStoreEndpoint --node monitor$i" &
xterm -hold -e "$QED agent --metrics 127.0.0.2:1820$i --alertsUrls $alertsStoreEndpoint monitor -k key -l debug --bind 127.0.0.1:820$i --join $qedGossipEndpoint --qedUrls $qedHTTPEndpoint --node monitor$i " &
pids+=($!)
done

for i in `seq 1 $3`;
do
xterm -hold -e "$QED agent --alertsUrls $alertsStoreEndpoint publisher -k key -l debug --bind 127.0.0.1:830$i --join $qedGossipEndpoint --pubUrls $snapshotStoreEndpoint --node publisher$i" &
xterm -hold -e "$QED agent --metrics 127.0.0.2:1830$i --alertsUrls $alertsStoreEndpoint publisher -k key -l debug --bind 127.0.0.1:830$i --join $qedGossipEndpoint --pubUrls $snapshotStoreEndpoint --node publisher$i " &
pids+=($!)
done

Expand Down
5 changes: 5 additions & 0 deletions tests/gossip/tamperhistory.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

curl -X PATCH http://localhost:18800/tamper -H 'Api-Key: blah' -d \
'{"digest":"$1", "value":"$2"}'

5 changes: 5 additions & 0 deletions tests/gossip/tamperhyper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

curl -X DELETE http://localhost:18800/tamper -H 'Api-Key: blah' -d \
'{"digest":"'$1'" , "value": "'$2'"}'

0 comments on commit 11422e2

Please sign in to comment.