Unverified Commit c846bbe2 authored by kladko's avatar kladko

SKALE-2167 Fixed container

parent f511798c
version: '3' version: '3'
services: services:
sgxwallet: sgxwallet:
image: skalenetwork/sgxwallet:latest image: skalenetwork/sgxwallet:latest_commit
ports: ports:
- "1026:1026" - "1026:1026"
- "1027:1027" - "1027:1027"
...@@ -17,6 +17,6 @@ services: ...@@ -17,6 +17,6 @@ services:
max-size: "10m" max-size: "10m"
max-file: "4" max-file: "4"
restart: unless-stopped restart: unless-stopped
command: -s command: -t
...@@ -31,10 +31,8 @@ assert subprocess.call(["docker", "image", "inspect", FULL_IMAGE_NAME]) == 0; ...@@ -31,10 +31,8 @@ assert subprocess.call(["docker", "image", "inspect", FULL_IMAGE_NAME]) == 0;
#assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data", #assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data",
# "-d", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX]) == 0 # "-d", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX]) == 0
obj = subprocess.Popen(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data","-d","--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX, "-y"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data","-d",
obj.communicate(input=b"i confirm", timeout=5) "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX, "-y"]) == 0
obj.terminate()
obj.wait()
time.sleep(5); time.sleep(5);
...@@ -58,9 +56,8 @@ s3.connect((address, 1028)) ...@@ -58,9 +56,8 @@ s3.connect((address, 1028))
s1.close() s1.close()
s2.close() s2.close()
s3.close() s3.close()
assert subprocess.call(["docker", "stop", "sgxwallet"]) == 0
assert subprocess.call(["docker", "rm", "sgxwallet"]) == 0
assert subprocess.call(["rm", "-rf", topDir + "/sgx_data"]) == 0
assert subprocess.call(["docker", "run", "-v", topDir + "/sgx_data:/usr/src/sdk/sgx_data","-ti",
"--name", "sgxwallet", "--network=host", "skalenetwork/" + IMAGE_NAME +":" + TAG_POSTFIX, "-t"]) == 0
\ No newline at end of file
...@@ -136,7 +136,7 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") { ...@@ -136,7 +136,7 @@ TEST_CASE("BLS key encrypt/decrypt", "[bls-key-encrypt-decrypt]") {
DEBUG_PRINT = 1; DEBUG_PRINT = 1;
is_sgx_https = 0; is_sgx_https = 0;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
//init_enclave(); //init_enclave();
...@@ -549,7 +549,7 @@ TEST_CASE("BLS_DKG test", "[bls_dkg]") { ...@@ -549,7 +549,7 @@ TEST_CASE("BLS_DKG test", "[bls_dkg]") {
is_sgx_https = 0; is_sgx_https = 0;
DEBUG_PRINT = 1; DEBUG_PRINT = 1;
cerr << "test started" << endl; cerr << "test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
StubClient c(client, JSONRPC_CLIENT_V2); StubClient c(client, JSONRPC_CLIENT_V2);
...@@ -682,7 +682,7 @@ TEST_CASE("API test", "[api_test]") { ...@@ -682,7 +682,7 @@ TEST_CASE("API test", "[api_test]") {
is_sgx_https = 0; is_sgx_https = 0;
//cerr << __GNUC__ << endl; //cerr << __GNUC__ << endl;
cerr << "API test started" << endl; cerr << "API test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
//HttpServer httpserver(1025); //HttpServer httpserver(1025);
//SGXWalletServer s(httpserver, //SGXWalletServer s(httpserver,
// JSONRPC_SERVER_V2); // hybrid server (json-rpc 1.0 & 2.0) // JSONRPC_SERVER_V2); // hybrid server (json-rpc 1.0 & 2.0)
...@@ -785,7 +785,7 @@ TEST_CASE("API test", "[api_test]") { ...@@ -785,7 +785,7 @@ TEST_CASE("API test", "[api_test]") {
TEST_CASE("getServerStatus test", "[getServerStatus_test]") { TEST_CASE("getServerStatus test", "[getServerStatus_test]") {
is_sgx_https = 0; is_sgx_https = 0;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
StubClient c(client, JSONRPC_CLIENT_V2); StubClient c(client, JSONRPC_CLIENT_V2);
REQUIRE(c.getServerStatus()["status"] == 0); REQUIRE(c.getServerStatus()["status"] == 0);
...@@ -909,7 +909,7 @@ TEST_CASE("ManySimultaneousThreads", "[many_threads_test]") { ...@@ -909,7 +909,7 @@ TEST_CASE("ManySimultaneousThreads", "[many_threads_test]") {
DEBUG_PRINT = 1; DEBUG_PRINT = 1;
is_aes = 1; is_aes = 1;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
vector<thread> threads; vector<thread> threads;
int num_threads = 4; int num_threads = 4;
...@@ -930,7 +930,7 @@ TEST_CASE("ecdsa API test", "[ecdsa_api_test]") { ...@@ -930,7 +930,7 @@ TEST_CASE("ecdsa API test", "[ecdsa_api_test]") {
is_aes = 1; is_aes = 1;
cerr << "ecdsa_api_test started" << endl; cerr << "ecdsa_api_test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
...@@ -980,7 +980,7 @@ TEST_CASE("dkg API test", "[dkg_api_test]") { ...@@ -980,7 +980,7 @@ TEST_CASE("dkg API test", "[dkg_api_test]") {
is_sgx_https = 0; is_sgx_https = 0;
cerr << "dkg_api_test started" << endl; cerr << "dkg_api_test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
...@@ -1057,7 +1057,7 @@ TEST_CASE("isPolyExists test", "[is_poly_test]") { ...@@ -1057,7 +1057,7 @@ TEST_CASE("isPolyExists test", "[is_poly_test]") {
is_sgx_https = 0; is_sgx_https = 0;
cerr << "is_poly_test started" << endl; cerr << "is_poly_test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
...@@ -1089,7 +1089,7 @@ TEST_CASE("AES_DKG test", "[aes_dkg]") { ...@@ -1089,7 +1089,7 @@ TEST_CASE("AES_DKG test", "[aes_dkg]") {
reset_db(); reset_db();
cerr << "test started" << endl; cerr << "test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
StubClient c(client, JSONRPC_CLIENT_V2); StubClient c(client, JSONRPC_CLIENT_V2);
...@@ -1219,7 +1219,7 @@ TEST_CASE("bls_sign_api test", "[bls_sign]") { ...@@ -1219,7 +1219,7 @@ TEST_CASE("bls_sign_api test", "[bls_sign]") {
is_aes = 1; is_aes = 1;
cerr << "test started" << endl; cerr << "test started" << endl;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
cerr << "Server inited" << endl; cerr << "Server inited" << endl;
HttpClient client("http://localhost:1029"); HttpClient client("http://localhost:1029");
StubClient c(client, JSONRPC_CLIENT_V2); StubClient c(client, JSONRPC_CLIENT_V2);
...@@ -1252,7 +1252,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") { ...@@ -1252,7 +1252,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") {
DEBUG_PRINT = 1; DEBUG_PRINT = 1;
is_sgx_https = 0; is_sgx_https = 0;
init_all(false, false, init_SEK); init_all(false, true, init_SEK);
//init_enclave(); //init_enclave();
int errStatus = -1; int errStatus = -1;
...@@ -1281,7 +1281,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") { ...@@ -1281,7 +1281,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") {
//TEST_CASE("BLS key import", "[bls-key-import]") { //TEST_CASE("BLS key import", "[bls-key-import]") {
// reset_db(); // reset_db();
// init_all(false, false); // init_all(false, true);
// //
// //
// //
...@@ -1321,7 +1321,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") { ...@@ -1321,7 +1321,7 @@ TEST_CASE("AES encrypt/decrypt", "[AES-encrypt-decrypt]") {
// //
// reset_db(); // reset_db();
// //
// init_all(false, false); // init_all(false, true);
// //
// //
// auto result = importBLSKeyShareImpl( TEST_BLS_KEY_SHARE, TEST_BLS_KEY_NAME, 2, 2, 1); // auto result = importBLSKeyShareImpl( TEST_BLS_KEY_SHARE, TEST_BLS_KEY_NAME, 2, 2, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment