Commit 7ad87297 authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira

Merge branch 'issue/20' into 'development'

Issue #20: Lock docker image

See merge request !116
parents e384d9ce 7c20d6ad
Pipeline #21938 passed with stages
in 30 minutes and 29 seconds
......@@ -9,6 +9,7 @@ stages:
pattern:
stage: lint
image: 'debian:stretch'
tags:
- regular
- debian
......@@ -21,6 +22,7 @@ pattern:
compileUnix:
stage: build
image: 'debian:stretch'
artifacts:
paths:
- agent-1234.run
......@@ -39,7 +41,7 @@ compileUnix:
- make
- cd ..
- chmod +x generate_agent.sh
- ./generate_agent.sh -idp=1234 -ws=www.C3Sl.ufpr.br -pch=simmcdev.c3sl.ufpr.br -pcp=8000 -pcu=ninguem -pcpasswd=123mudar -prj=simmc
- ./generate_agent.sh -idp=1234 -ws=www.C3Sl.ufpr.br -pch=simmcdev.c3sl.ufpr.br -pcp=3000 -pcu=ninguem -pcpasswd=123mudar -prj=simmc
- chmod +x agent-1234.run
compileWin32:
......@@ -64,7 +66,7 @@ compileWin32:
- Xvfb :98 &
- export DISPLAY=:98
- cd /
- wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=8000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
- wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=3000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
- mv ./builds/simmctic/agent/agent-1234.exe ./builds/simmctic/agent/agent-32.exe
compileWin64:
......@@ -88,11 +90,12 @@ compileWin64:
- Xvfb :98 &
- export DISPLAY=:98
- cd /
- wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=8000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
- wine /home/inno/iscc ./builds/simmctic/agent/generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=simmcdev.c3sl.ufpr.br /Dpcp=3000 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
- mv ./builds/simmctic/agent/agent-1234.exe ./builds/simmctic/agent/agent-64.exe
testDebian:
stage: test
image: 'debian:stretch'
tags:
- regular
- debian
......@@ -112,6 +115,7 @@ testDebian:
testUbuntu:
stage: test
image: 'ubuntu:16.04'
tags:
- ubuntu
- regular
......
......@@ -35,8 +35,8 @@ std::string get_bios_date() {
+ "/bios_date is empty";
throw err;
}
d = line.substr(0, 2);
m = line.substr(3, 2);
m = line.substr(0, 2);
d = line.substr(3, 2);
y = line.substr(6, 4);
format = y + "-" + m + "-" + d;
} else {
......
......@@ -132,7 +132,7 @@ Json::Value get_inventory(Agent* agent) {
inv["data_inventory"]["disk1_size"] = Json::nullValue;
inv["data_inventory"]["disk2_model"] = Json::nullValue;
inv["data_inventory"]["disk2_size"] = Json::nullValue;
inv["data_inventory"]["extra_hds"] = Json::nullValue;
inv["data_inventory"]["extra_hds"] = 0;
inv["error_inventory"]["disk1_model"] = err;
inv["error_inventory"]["disk1_size"] = err;
......
......@@ -49,9 +49,9 @@ int send_inventory(bool print, Agent* agent) {
else if (agent->getConnection()->sendJson(agent,
fastWriter.write(inventory), 1, 1) == 200)
return 1;
} else {
return 0;
}
return 0;
}
/***************************************
......@@ -82,9 +82,9 @@ int send_net_bandwidth(bool print, Agent* agent) {
else if (agent->getConnection()->sendJson(agent,
fastWriter.write(net), 2, 1) == 200)
return 1;
} else {
return 0;
}
return 0;
}
/**********************************
......@@ -115,9 +115,9 @@ int send_user_history(bool print, Agent* agent) {
else if (agent->getConnection()->sendJson(agent,
fastWriter.write(u_h), 3, 1) == 200)
return 1;
} else {
return 0;
}
return 0;
}
/**
......
......@@ -4,5 +4,35 @@
echo $? > exit_status
echo "{" > inventory.json && jq ."data_inventory" export.json | awk '/{/{flag=1;next}/}/{flag=0}flag' >> inventory.json && echo "}" >> inventory.json
echo "{" > net.json && jq ."data_net" export.json | awk '/{/{flag=1;next}/}/{flag=0}flag' >> net.json && echo "}" >> net.json
cat inventory.json
cat net.json
\ No newline at end of file
# retrieve data , clean data and turn into a clean json
########################################################
# debug only #
########################################################
# echo "export.json"
# cat export.json
# echo "inventory"
# cat inventory.json
# echo "net"
# cat net.json
##########################################################
# exit status #
##########################################################
echo "exit status"
cat exit_status
# exit status valures:
# 0 : all data was sent
# 1 : send_inventory was not sent
# 2 : net_bandwidth was not sent
# 3 : send_inventory and net_bandwidth was not sent
# 4 : user_history was not sent
# 5 : user_history and send_inventory was not sent
# 6 : user_history and net_bandwidth was not set
# 7 : all data was not sent
......@@ -80,7 +80,7 @@ function user () {
function port() {
obj=$(cat /opt/agentC3SL/conf/proxy-conf.json | jq -r '.port')
[[ "$obj" -eq 8000 ]]
[[ "$obj" -eq 3000 ]]
}
function host() {
......
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