Skip to content

Commit

Permalink
set +e not +x
Browse files Browse the repository at this point in the history
  • Loading branch information
John-LittleBearLabs committed Sep 16, 2024
1 parent 3039a1c commit 9b3e661
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
22 changes: 11 additions & 11 deletions .github/tour.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo Build clitester
cmake --build tester_build --config Release

echo Start test server
( timeout 999 python3 ./ipfs_chromium/test_data/test_server.py 8080 2>&1 | tee server.log & ) &
( (timeout 1999 python3 ./ipfs_chromium/test_data/test_server.py 8080 2>&1 ; echo -e '\n LOCALHOST SERVER EXITING FROM TIMEOUT \n ') | tee server.log & ) &
for t in 1{0..9}
do
if grep -n . server.log
Expand All @@ -59,15 +59,15 @@ function url_case() {
echo "test case description =${4}"
ll="${5-note}"
echo "log level = ${ll}"
set +x
timeout 440 ./tester_build/clitester "${ll}" "${1}://${2}"
set +e
timeout 441 ./tester_build/clitester "${ll}" "${1}://${2}"
ec=$?
set -x
set -e
if [ ${ec} -eq 0 ]
then
echo clitester exited with successful status
else
echo "Directly reported error code ${ec} from clitester run - usually means timeout killed it. " "${@}"
echo "Directly reported error code ${ec} from clitester run - usually means timeout killed it. " "${@}"
exit 6
fi
n="$(sed 's,[^A-Za-z0-9\.],_,g' <<< ${2})"
Expand Down Expand Up @@ -100,13 +100,13 @@ function url_case() {
}

unstable_case() {
set +x
timeout 401 ./tester_build/clitester "ipns://${1}"
ec=$?
set -x
if [ ${ec} -ne 0 ]
set +e
timeout 402 ./tester_build/clitester "ipns://${1}"
ec=$?
set -e
if [ ${ec} -ne 0 ]
then
echo "clitester (or timeout) failed with exit code ${ec} for ipns://${1}"
echo "clitester (or timeout) failed with exit code ${ec} for ipns://${1}"
exit 5
fi
n=`sed 's,[^A-Za-z0-9\.],_,g' <<< ${1}`
Expand Down
2 changes: 1 addition & 1 deletion library/src/ipfs_client/ctx/transitory_gateway_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ unsigned Self::RoutingApiDiscoveryDefaultRate() const {
return 60U;
}
bool Self::RoutingApiDiscoveryOfUnencryptedGateways() const {
return false;
return true;
}
int Self::GetTypeAffinity(std::string_view, gw::GatewayRequestType) const {
return 9;
Expand Down
Binary file not shown.
9 changes: 5 additions & 4 deletions test_data/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ def do_GET(self):
match components[1]:
case 'ipfs':
if len(components) == 3:
path = join(here, 'blocks')
path = join(here, 'blocks', components[2])
else:
path = join(here, 'cars')
path = join(here, 'cars', components[2])
case 'ipns':
path = join(here, 'names')
for comp in components[2:]:
if len(path) > 0:
path = join(path, comp.split('?')[0])
case 'routing':
self.respond(join(here, 'gotit.json'))
return
case _ :
print(f"{self.path} ({components}) not handled request type ({components[0]})", file=sys.stderr)
exit(9)
for comp in components[2:]:
path = join(path, comp)
self.respond(path)

def respond(self, path):
Expand Down

0 comments on commit 9b3e661

Please sign in to comment.