Skip to content

Commit cf44b57

Browse files
mwfarbjuagargi
authored andcommitted
updating paths used and lack of scion.sh
1 parent 1956b66 commit cf44b57

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

webapp/lib/health.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,22 @@ func HealthCheckHandler(w http.ResponseWriter, r *http.Request, options *CmdOpti
7070
}
7171
log.Debug("HealthCheckHandler", "resFileHealthCheck", string(raw))
7272

73-
err = os.Setenv("SCION_ROOT", options.ScionRoot+"/")
73+
err = os.Setenv("SCION_ROOT", path.Clean(options.ScionRoot))
7474
if CheckError(err) {
7575
fmt.Fprintf(w, `{ "err": "`+err.Error()+`" }`)
7676
return
7777
}
78-
err = os.Setenv("SCION_BIN", options.ScionBin+"/")
78+
err = os.Setenv("SCION_BIN", path.Clean(options.ScionBin))
7979
if CheckError(err) {
8080
fmt.Fprintf(w, `{ "err": "`+err.Error()+`" }`)
8181
return
8282
}
83-
err = os.Setenv("SCION_GEN", options.ScionGen+"/")
83+
err = os.Setenv("SCION_GEN", path.Clean(options.ScionGen))
8484
if CheckError(err) {
8585
fmt.Fprintf(w, `{ "err": "`+err.Error()+`" }`)
8686
return
8787
}
88-
err = os.Setenv("SCION_LOGS", options.ScionLogs+"/")
88+
err = os.Setenv("SCION_LOGS", path.Clean(options.ScionLogs))
8989
if CheckError(err) {
9090
fmt.Fprintf(w, `{ "err": "`+err.Error()+`" }`)
9191
return

webapp/web/tests/health/testSCIONRunning.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,21 @@ error_exit()
77
exit 1
88
}
99

10+
# allow IA via args, ignoring gen/ia
11+
iaFile=$(echo $1 | sed "s/:/_/g")
12+
echo "IA found: $iaFile"
13+
14+
isd=$(echo ${iaFile} | cut -d"-" -f1)
1015

1116
# check if "./scion.sh status" returns anything, fail if it does
12-
cd $SCION_ROOT
13-
status="$(bash $SCION_ROOT/scion.sh status 2>&1)"
17+
if [ $isd -ge 16 ]; then
18+
status="$(systemctl -t service --failed | grep scion-*.service 2>&1)"
19+
else
20+
# localhost testing
21+
cd $SCION_ROOT
22+
status="$($SCION_ROOT/scion.sh status 2>&1)"
23+
fi
24+
1425
if [[ $status ]]
1526
then
1627
echo "SCION status has reported a problem: $status."
@@ -46,11 +57,6 @@ else
4657
fi
4758
}
4859

49-
# allow IA via args, ignoring gen/ia
50-
iaFile=$(echo $1 | sed "s/:/_/g")
51-
echo "IA found: $iaFile"
52-
53-
isd=$(echo ${iaFile} | cut -d"-" -f1)
5460

5561
if [ $isd -ge 16 ]; then
5662
# not used for localhost testing

0 commit comments

Comments
 (0)