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

Problem:(CRO-541) no automated test for jailing, unjailing using liveness faults #604

Merged
merged 1 commit into from
Dec 12, 2019

Conversation

leejw51
Copy link
Contributor

@leejw51 leejw51 commented Nov 19, 2019

Solution:add integration test using docker-compose

@leejw51crypto
Copy link
Collaborator

leejw51crypto commented Nov 20, 2019

because simultaneous integration test is the cause,
I'll find a way to serialize integration , not all integration tests at the same time

it's tested on i7 cpu with 16 GB ram

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems the test doesn't run on drone -- if you need something in the environment, you can use nix:
https://github.com/crypto-com/chain/blob/master/ci-scripts/drone.nix
https://github.com/crypto-com/chain/blob/master/.drone.yml#L43

@@ -44,6 +44,9 @@ pub trait StakingRpc: Send + Sync {
to_address: String,
view_keys: Vec<String>,
) -> Result<String>;

#[rpc(name = "staking_unjail")]
fn unjail(&self, request: WalletRequest, unjail_address: String) -> Result<String>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you base it off the latest master? this was already merged: ce3c976 so this PR will only show things that changed or are new

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -0,0 +1,3 @@
#!/bin/bash
tendermint node --p2p.persistent_peers "e04c6e7fcda7f3947179871053cec8de7b7a20cb@chain0:26656"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be taken from environment variable instead of hardcoded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll move to env variable

@@ -0,0 +1,319 @@
# This is a TOML config file.
Copy link
Contributor

@tomtau tomtau Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this setup be generated instead of hardcoded?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be useful to incorporate the chain bot @yihuang wrote

Copy link
Contributor Author

@leejw51 leejw51 Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's possible, but scripts will be complex for now.
i'm thinking to make genesis generation directly by dev-conf.json directly.
i'll find a simpler way

Copy link
Collaborator

@leejw51crypto leejw51crypto Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll check yihuang's script

wait_for_ready(1)

count=2
while True:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this will hang forever (there's no timeout / max attempts) if the test fails?

Copy link
Contributor Author

@leejw51 leejw51 Nov 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll add time limit, maybe two hours.
because it's constantly polling, it's not necessary to re-attempt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the jailing period is 600s, do we want to reduce it to facilitate the test? Moreover, two hours timeout seems to be too long?

p.s. I think Drone.io has a 1 hour timeout right now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll change to 1 hour timeout

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's configured max 1 hour

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not around 10-20 minutes, if the jailing period is 10 minutes in the test?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@tomtau
Copy link
Contributor

tomtau commented Nov 20, 2019

@leejw51 @leejw51crypto not sure what packages you need, but if it's not available in nix directly, you can do something like:

with import <nixpkgs> {};
let dependencies = rec {

  _PACKAGEYOUNEED = with python37Packages; buildPythonPackage rec {
  pname = "PACKAGEYOUNEED";
  version = "1.0.0";

  doCheck = false;

  src = fetchPypi {
    inherit pname version;
    sha256 =
 "_PACKAGEYOUNEED_HASH";
  };

};
...

in with dependencies;
stdenv.mkDerivation rec {
  name = "env";

  # Mandatory boilerplate for buildable env
  env = buildEnv { name = name; paths = buildInputs; };
  builder = builtins.toFile "builder.sh" ''
    source $stdenv/setup; ln -s $env $out
  '';

  # Customizable development requirements
  buildInputs = [
    gmp
    pkgconfig
    (python37.buildEnv.override {
      ignoreCollisions = true;
      extraLibs = with python37Packages; [
         _PACKAGEYOUNEED
      ];
    })
  ];

  # Customizable development shell setup with at last SSL certs set
  shellHook = ''
    export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
  '';
}

Comment on lines 11 to 13
- "1022:22"
- "9981:9981"
- "26656:26656"
- "26657:26657"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as these ports are hardcoded, it won't be possible to run two tests in parallel -- @calvinaco @calvinlauco had something like that sorted in the existing integration tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only vm0 needs external port-mapping for client-rpc, i'll remove un-necessary ports.

Comment on lines 7 to 8
pip3 install docker
python3 ./disk/jail_test.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execute in nix -- no need for pip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -0,0 +1,3 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9VL9tO86mtzyI+Js3EzxGXGrH7uiYJyI8M4laBpmuRuxeS3aistg+LoQ9bOnDx4B6eVrXmr7BQ1zXZhtOSyJfiCvTV+3RZta89Rp9K1MuF6dcZA9nAtlsxW8vEnh0BEFtRlsrvJkR6LKrB3airMmTxjRb6SnLi0vD1DO0W4Y3n7hDhqdVruRBWt/oPDLPyFdu4Z9Ffk4uWPJqOgEk63qU+x2iiwgnIlHi7/NX9YQMXBKWCsJu5PVgyAAYfk86Wlq1l5xDQnBYK+V+tf6zMmlkLgBqJFXQca5UTqsSYPnW5AlxI6JIrJAOsxX+4e7Qf1sSil6hz1RHcKa+dtThEzqp user@hongkong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is ssh needed for the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is is for debugging, i'll remove it

Copy link
Contributor

@calvinlauyh calvinlauyh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be better to give the intention in the file names. e.g. connect1, connect2, connect3 to reveal what it is about.

Also integration-tests/jail/disk/config0/0.txt seems to be committed accidentailly

.drone.yml Outdated
commands:
- mkdir bin
- export PATH="$PATH:$PWD/bin"
- echo "OK"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed I think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

RUN apt-get install cmake libgflags-dev libzmq3-dev pkg-config -y
RUN apt-get install --no-install-recommends libssl-dev libzmq3-dev -y
RUN apt install unzip -y
RUN apt install tmux -y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to aggregate installation into one line to reduce layers. Also standardize the installation step to apt install

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #604 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #604      +/-   ##
==========================================
- Coverage   70.33%   70.33%   -0.01%     
==========================================
  Files         133      133              
  Lines       16404    16404              
==========================================
- Hits        11538    11537       -1     
- Misses       4866     4867       +1
Impacted Files Coverage Δ
chain-core/src/common/merkle_tree.rs 98.55% <0%> (-0.25%) ⬇️

Comment on lines 82 to 83
create_staking_address("a", "1")
create_staking_address("a", "1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why create staking address twice?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

return response.json()["result"]


def create_staking_address(name, passphrase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can create a python package for rpc client.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

#!/bin/bash
docker-compose up -d --build
echo "docker compose ok"
nix-shell -p python37Packages.docker --run "python3 ./disk/jail_test.py"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @tomtau

@leejw51crypto
Copy link
Collaborator

yes,
today i will do like below

  1. dynamically create 2 VM using chatbot script
  2. work it compiled with drone.io

@leejw51crypto
Copy link
Collaborator

checked

Comment on lines +143 to +144
- export JAIL_CLIENT_RPC=9981
- export JAIL_CHAIN_RPC=26657
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this fixed? wouldn't the ports change every time? isn't only docker-compose down enough?
also it means that only one test can run at a time? check with @calvinaco on the integration test tear down

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is only to make docker-compose down happy, when starting, the ports are chosen from free ports.

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As two instances of this test can't be executed in parallel, it'll be better that it's not triggered on every PR, so adding these conditions to the pipeline:

trigger:
  branch:
  - master
  - staging
  - trying
  event:
  - push

plus run all the docker-compose invocations with -p jail-<SOME UNIQUE/DETERMINISTIC ID IN ENV...>, so that docker-compose -p jail-<SOME UNIQUE/DETERMINISTIC ID IN ENV...> down will bring down the setup in that build rather than elsewhere

@leejw51crypto
Copy link
Collaborator

As two instances of this test can't be executed in parallel, it'll be better that it's not triggered on every PR, so adding these conditions to the pipeline:

trigger:
  branch:
  - master
  - staging
  - trying
  event:
  - push

plus run all the docker-compose invocations with -p jail-<SOME UNIQUE/DETERMINISTIC ID IN ENV...>, so that docker-compose -p jail-<SOME UNIQUE/DETERMINISTIC ID IN ENV...> down will bring down the setup in that build rather than elsewhere

i'll work on this

@leejw51crypto
Copy link
Collaborator

fixed using git commit hash
checking with drone

#!/bin/bash
echo "compile binaries"
cd ./compile
docker-compose up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's still this "network" for compiler -- how does this get shut down? running a compiler should be doable without creating a docker compose network

Copy link
Collaborator

@leejw51crypto leejw51crypto Dec 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this docker-compose is not daemon,
it's synchronous.
no need to tear-down.

multiple running is fine.

@tomtau
Copy link
Contributor

tomtau commented Dec 11, 2019

the test fails:


1107	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
1108	    chunked=chunked,
1109	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
1110	    six.raise_from(e, None)
1111	  File "<string>", line 3, in raise_from
1112	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
1113	    httplib_response = conn.getresponse()
1114	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 1344, in getresponse
1115	    response.begin()
1116	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 306, in begin
1117	    version, status, reason = self._read_status()
1118	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 267, in _read_status
1119	    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
1120	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/socket.py", line 589, in readinto
1121	    return self._sock.recv_into(b)
1122	ConnectionResetError: [Errno 104] Connection reset by peer
1123	
1124	During handling of the above exception, another exception occurred:
1125	
1126	Traceback (most recent call last):
1127	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
1128	    timeout=timeout
1129	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
1130	    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
1131	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/util/retry.py", line 400, in increment
1132	    raise six.reraise(type(error), error, _stacktrace)
1133	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/packages/six.py", line 734, in reraise
1134	    raise value.with_traceback(tb)
1135	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
1136	    chunked=chunked,
1137	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
1138	    six.raise_from(e, None)
1139	  File "<string>", line 3, in raise_from
1140	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
1141	    httplib_response = conn.getresponse()
1142	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 1344, in getresponse
1143	    response.begin()
1144	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 306, in begin
1145	    version, status, reason = self._read_status()
1146	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 267, in _read_status
1147	    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
1148	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/socket.py", line 589, in readinto
1149	    return self._sock.recv_into(b)
1150	urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
1151	
1152	During handling of the above exception, another exception occurred:
1153	
1154	Traceback (most recent call last):
1155	  File "../bot/jail_test.py", line 180, in <module>
1156	    p.main()
1157	  File "../bot/jail_test.py", line 151, in main
1158	    self.restore_wallets()
1159	  File "../bot/jail_test.py", line 51, in restore_wallets
1160	    self.rpc.wallet.restore(self.node0_mnemonics, "a")
1161	  File "/tmp/drone-ww5UJ6JLqezwsnYK/drone/src/integration-tests/bot/chainrpc.py", line 78, in restore
1162	    return call('wallet_restore', [name, get_passphrase()], mnemonics)
1163	  File "/tmp/drone-ww5UJ6JLqezwsnYK/drone/src/integration-tests/bot/chainrpc.py", line 22, in call
1164	    rsp = request(CLIENT_RPC_URL, method, *args, **kwargs)
1165	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/__init__.py", line 8, in request
1166	    return HTTPClient(endpoint).request(*args, **kwargs)
1167	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/apply_defaults/decorators.py", line 13, in wrapper
1168	    return function(self, *args, **kwargs)
1169	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/client.py", line 232, in request
1170	    validate_against_schema=validate_against_schema,
1171	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/apply_defaults/decorators.py", line 13, in wrapper
1172	    return function(self, *args, **kwargs)
1173	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/client.py", line 168, in send
1174	    request_text, response_expected=response_expected, **kwargs
1175	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/clients/http_client.py", line 63, in send_message
1176	    response = self.session.post(self.endpoint, data=request.encode(), **kwargs)
1177	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 581, in post
1178	    return self.request('POST', url, data=data, json=json, **kwargs)
1179	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
1180	    resp = self.send(prep, **send_kwargs)
1181	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
1182	    r = adapter.send(request, **kwargs)
1183	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
1184	    raise ConnectionError(err, request=request)
1185	requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))


---
kind: pipeline
type: exec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this execute in docker instead of exec? could use this base image https://hub.docker.com/r/nixos/nix/ ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same with our integration test.

@leejw51crypto
Copy link
Collaborator

prior error is fixed,
this is python error.
i'm looking into it.

@leejw51crypto
Copy link
Collaborator

the test fails:


1107	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
1108	    chunked=chunked,
1109	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
1110	    six.raise_from(e, None)
1111	  File "<string>", line 3, in raise_from
1112	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
1113	    httplib_response = conn.getresponse()
1114	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 1344, in getresponse
1115	    response.begin()
1116	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 306, in begin
1117	    version, status, reason = self._read_status()
1118	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 267, in _read_status
1119	    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
1120	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/socket.py", line 589, in readinto
1121	    return self._sock.recv_into(b)
1122	ConnectionResetError: [Errno 104] Connection reset by peer
1123	
1124	During handling of the above exception, another exception occurred:
1125	
1126	Traceback (most recent call last):
1127	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
1128	    timeout=timeout
1129	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
1130	    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
1131	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/util/retry.py", line 400, in increment
1132	    raise six.reraise(type(error), error, _stacktrace)
1133	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/packages/six.py", line 734, in reraise
1134	    raise value.with_traceback(tb)
1135	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
1136	    chunked=chunked,
1137	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
1138	    six.raise_from(e, None)
1139	  File "<string>", line 3, in raise_from
1140	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
1141	    httplib_response = conn.getresponse()
1142	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 1344, in getresponse
1143	    response.begin()
1144	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 306, in begin
1145	    version, status, reason = self._read_status()
1146	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/http/client.py", line 267, in _read_status
1147	    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
1148	  File "/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5/lib/python3.7/socket.py", line 589, in readinto
1149	    return self._sock.recv_into(b)
1150	urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
1151	
1152	During handling of the above exception, another exception occurred:
1153	
1154	Traceback (most recent call last):
1155	  File "../bot/jail_test.py", line 180, in <module>
1156	    p.main()
1157	  File "../bot/jail_test.py", line 151, in main
1158	    self.restore_wallets()
1159	  File "../bot/jail_test.py", line 51, in restore_wallets
1160	    self.rpc.wallet.restore(self.node0_mnemonics, "a")
1161	  File "/tmp/drone-ww5UJ6JLqezwsnYK/drone/src/integration-tests/bot/chainrpc.py", line 78, in restore
1162	    return call('wallet_restore', [name, get_passphrase()], mnemonics)
1163	  File "/tmp/drone-ww5UJ6JLqezwsnYK/drone/src/integration-tests/bot/chainrpc.py", line 22, in call
1164	    rsp = request(CLIENT_RPC_URL, method, *args, **kwargs)
1165	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/__init__.py", line 8, in request
1166	    return HTTPClient(endpoint).request(*args, **kwargs)
1167	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/apply_defaults/decorators.py", line 13, in wrapper
1168	    return function(self, *args, **kwargs)
1169	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/client.py", line 232, in request
1170	    validate_against_schema=validate_against_schema,
1171	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/apply_defaults/decorators.py", line 13, in wrapper
1172	    return function(self, *args, **kwargs)
1173	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/client.py", line 168, in send
1174	    request_text, response_expected=response_expected, **kwargs
1175	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/jsonrpcclient/clients/http_client.py", line 63, in send_message
1176	    response = self.session.post(self.endpoint, data=request.encode(), **kwargs)
1177	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 581, in post
1178	    return self.request('POST', url, data=data, json=json, **kwargs)
1179	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
1180	    resp = self.send(prep, **send_kwargs)
1181	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
1182	    r = adapter.send(request, **kwargs)
1183	  File "/nix/store/skrgyxx1rng49v5ckmakgmshpqps97w8-python3-3.7.5-env/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
1184	    raise ConnectionError(err, request=request)
1185	requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

this is fixed

@leejw51crypto
Copy link
Collaborator

leejw51crypto commented Dec 11, 2019

could you run again?
CURRENT_HASH is not updated to jail_test.py
it's added

@devashishdxt
Copy link
Collaborator

bors try

bors bot added a commit that referenced this pull request Dec 11, 2019
@leejw51crypto
Copy link
Collaborator

bors try

@bors
Copy link
Contributor

bors bot commented Dec 11, 2019

🔒 Permission denied

Existing reviewers: click here to make leejw51crypto a reviewer

@leejw51crypto
Copy link
Collaborator

checked

@bors
Copy link
Contributor

bors bot commented Dec 11, 2019

try

Timed out

@leejw51 leejw51 force-pushed the cro-541 branch 2 times, most recently from 4375837 to 8c978f4 Compare December 11, 2019 17:40
@tomtau
Copy link
Contributor

tomtau commented Dec 12, 2019

@leejw51crypto can you squash the commits and rebase them on top of the latest master?

…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


use TENDERMINT_FLAG env variable


remove ssh


remove un-necessary script


remove redundant code


tidy up


fix nix path


add nix


tidy up


tidy up

add nix path


tidy up folders


add path

fix nix path


tidy up port


bind random port for simulataneous testing


tidy up yml


tidy up files


activate test


add zmq

fix nix

compile

fix display

compile

zeromq

fix jail.nix

activate compiling

fix toml


remove config

remove config

recompile

add clang

change docker source

fix FROM

try with localhost

change to url


update chainbot


tidy up


tidy up ports


tidy up assert

tidy up python

remove go0,go1

fix python exception

remove ssh


add tear down


fix python test

change name


fix python exception warning

tidy validators

remove un-necessary assert

remove un-necessary import

update chainbot markdown

apply dummy env

tidy up


do not use config directly

remove tendermint argment

handled in config.toml
add project to docker-compose


fix current_hash


activate compile

use project name in compiling

support simultaneous running


give enough time to boot up

because if it's run simultaneously, 1/n times slower
for tendermint, it takes long time~
restore to simple code


make faster
@tomtau
Copy link
Contributor

tomtau commented Dec 12, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 12, 2019
604: Problem:(CRO-541) no automated test for jailing, unjailing using liveness faults r=tomtau a=leejw51

Solution:add integration test using docker-compose

Co-authored-by: Jongwhan Lee <jonghwan@crypto.com>
@bors
Copy link
Contributor

bors bot commented Dec 12, 2019

@bors bors bot merged commit e713bac into crypto-com:master Dec 12, 2019
bors bot added a commit that referenced this pull request Dec 21, 2020
2401: Bump cbindgen from 0.15.0 to 0.16.0 r=tomtau a=dependabot-preview[bot]

Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.15.0 to 0.16.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/eqrion/cbindgen/blob/master/CHANGES">cbindgen's changelog</a>.</em></p>
<blockquote>
<h2>0.16.0</h2>
<pre><code> * Remove artificial restriction on lifetime parameters on enums ([#604](mozilla/cbindgen#604))
 * Add an option for converting usize/isize into size_t/ptrdiff_t. ([#606](mozilla/cbindgen#606))
 * Allow controlling the cargo profile used for expansion. ([#607](mozilla/cbindgen#607))
 * Support wider range of expressions in enum discriminants ([#614](mozilla/cbindgen#614))
 * Support generation of Cython bindings ([#590](mozilla/cbindgen#590))
 * Fixed some issues with style=tag and recursive structs ([#615](mozilla/cbindgen#615))
 * Default C style to Both (as specified in docs) ([#615](mozilla/cbindgen#615))
 * Fix resolution of path dependencies from certain modules. ([#629](mozilla/cbindgen#629))
 * Support inlined definitions for tuple variants with a single field in C ([#631](mozilla/cbindgen#631))
</code></pre>
<p>Thanks to all the awesome contributors that contributed to this release.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/eqrion/cbindgen/commit/a00b4215a907601680f6e9acaf93df1cbafa8ded"><code>a00b421</code></a> v0.16.0</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/b82e37525478d7d0bddbea2baf27e2eb9434531f"><code>b82e375</code></a> enum: Support inlined definitions for tuple variants with a single field</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/eaf3e57e743dba7621bfa59d0c5bf0656a79cb71"><code>eaf3e57</code></a> enum: Remove some redundant function parameters</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/0083c43e13c384787023c1fc8c491744d9f41070"><code>0083c43</code></a> Remove <code>Struct::tuple_struct</code></li>
<li><a href="https://github.com/eqrion/cbindgen/commit/8a5db0baebfd45f4c43681151d111cdcb31bc6c5"><code>8a5db0b</code></a> Minor cleanup to <code>fn close_brace</code></li>
<li><a href="https://github.com/eqrion/cbindgen/commit/1963f0c92e93456359713db353aa6276f6200f7b"><code>1963f0c</code></a> Partially support <code>#[cfg]</code>s on fields</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/dfcee869ba536e661a0c972b5407ea3a5579d960"><code>dfcee86</code></a> enum: Do not forget to rename entities in enum discriminants</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/fbc2237b7d7b8ab250ec184c709bc5d4129fceab"><code>fbc2237</code></a> parser: Fix resolution of #[path] dependencies from certain modules.</li>
<li><a href="https://github.com/eqrion/cbindgen/commit/9f558e30f3313f2fe6fcdc172b6f86c619564414"><code>9f558e3</code></a> enum: <code>enum_name</code> -&gt; <code>tag_name</code></li>
<li><a href="https://github.com/eqrion/cbindgen/commit/8997277cb71922b028a003349c59bd87ae0afe4d"><code>8997277</code></a> enum: Break up <code>Enum::write</code> into multiple functions</li>
<li>Additional commits viewable in <a href="https://github.com/eqrion/cbindgen/compare/v0.15.0...v0.16.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cbindgen&package-manager=cargo&previous-version=0.15.0&new-version=0.16.0)](https://dependabot.com/compatibility-score/?dependency-name=cbindgen&package-manager=cargo&previous-version=0.15.0&new-version=0.16.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants