Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Problem:(CRO-541) no automated test for jailing, unjailing using live…
Browse files Browse the repository at this point in the history
…ness faults

add bin scripts

add jailing intergration test

add validators


jail test

show status

check staked state after unjail


wait for test

activate jailing, unjailing intergration test


tidy up

tidy up


add python error exit


tidy up


make apt install as one line
  • Loading branch information
leejw51crypto committed Nov 20, 2019
1 parent 3aeb130 commit a6cf08e
Show file tree
Hide file tree
Showing 48 changed files with 1,842 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,26 @@ trigger:
event:
- push


---
kind: pipeline
type: exec
name: integration-tests-jail-unjail

platform:
os: linux
arch: amd64

steps:
- name: integration-tests
commands:
- mkdir bin
- export PATH="$PATH:$PWD/bin"
- echo "OK"
- cd integration-tests/jail
- ./run.sh


---
kind: signature
hmac: cf4d1c1fdb5895f7fa7bcf7edb0e1fe4131cf8d9d548a46cb8f4aca4e182d4ab
Expand Down
1 change: 1 addition & 0 deletions integration-tests/jail/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
24 changes: 24 additions & 0 deletions integration-tests/jail/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM baiduxlab/sgx-rust:1804-1.0.9
LABEL maintainer="Crypto.com"

RUN echo 'source /opt/sgxsdk/environment' >> /root/.docker_bashrc
RUN echo 'source /root/.cargo/env' >> /root/.docker_bashrc
RUN apt-get update
RUN rm -rf /var/lib/apt/lists/*
RUN apt update
RUN apt install -y --no-install-recommends whois wget curl python3 libssl-dev libcurl4-openssl-dev libelf-dev libdw-dev gcc binutils-dev libc6-dev pkg-config build-essential openssh-server cmake libgflags-dev libzmq3-dev pkg-config libssl-dev libzmq3-dev unzip tmux
ENV SGX_MODE=SW
ENV NETWORK_ID=AB
ENV RUSTFLAGS=-Ctarget-feature=+aes,+ssse3
ENV PATH=$HOME/bin:$PATH
ENV APP_PORT=25933
ENV TX_ENCLAVE_STORAGE=/enclave-storage
ENV LD_LIBRARY_PATH=$HOME/lib
ENV PKG_CONFIG_PATH=$HOME/lib/pkgconfig
COPY ./ssh /root/.ssh
COPY ./bin /root/bin
RUN cd /root/bin && wget https://github.com/tendermint/tendermint/releases/download/v0.32.6/tendermint_v0.32.6_linux_amd64.zip
RUN cd /root/bin && unzip ./tendermint_v0.32.6_linux_amd64.zip
RUN /root/bin/tendermint unsafe_reset_all
CMD ["sleep","infinity"]

2 changes: 2 additions & 0 deletions integration-tests/jail/bin/abci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./chain-abci --host 0.0.0.0 --port 26658 --chain_id test-ab --genesis_app_hash C8B1101B2FDF6684046C4F0E6BEE9FE595433AAC5200A3EFFD7CC77A9FD27E7C --enclave_server tcp://127.0.0.1:25933
2 changes: 2 additions & 0 deletions integration-tests/jail/bin/aesm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
LD_LIBRARY_PATH=/opt/intel/libsgx-enclave-common/aesm /opt/intel/libsgx-enclave-common/aesm/aesm_service
2 changes: 2 additions & 0 deletions integration-tests/jail/bin/client-rpc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
./client-rpc --chain-id test-ab --port 9981 --storage-dir ./.storage --websocket-url ws://127.0.0.1:26657/websocket
2 changes: 2 additions & 0 deletions integration-tests/jail/bin/enclave.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
./tx-validation-app tcp://0.0.0.0:25933
3 changes: 3 additions & 0 deletions integration-tests/jail/bin/tendermint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
tendermint node --p2p.persistent_peers "e04c6e7fcda7f3947179871053cec8de7b7a20cb@chain0:26656"

3 changes: 3 additions & 0 deletions integration-tests/jail/bin/tendermint0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
tendermint node --rpc.laddr=tcp://0.0.0.0:26657

2 changes: 2 additions & 0 deletions integration-tests/jail/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker build . -t chain_test
2 changes: 2 additions & 0 deletions integration-tests/jail/connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -p 1022:22 -v $(pwd)/disk:/root/disk --rm -it chain_test /bin/bash
2 changes: 2 additions & 0 deletions integration-tests/jail/connect2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run -p 1022:22 chain_test
2 changes: 2 additions & 0 deletions integration-tests/jail/connect3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
ssh root@localhost -p 1022
Empty file.
Loading

0 comments on commit a6cf08e

Please sign in to comment.