Skip to contentSkip to conversation

add http proxy

PATCH Applied Song Cai 2 participants 2 messages Oct 13, 2017 – Oct 17, 2017

lore
Share & tools
lore

Song Cai

author
#0 lore raw

PATCH 2/18 add http proxy

add http proxy for curl

---
 engine/tests/Functional.curl/fuego_test.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
engine/tests/Functional.curl/fuego_test.sh +2 -1
index 90d24dd..5f8d71a 100755
@@ -1,5 +1,6 @@
 function test_run {
-    report "if curl -o test.html www.baidu.com > /dev/null; then echo 'TEST-1 OK'; else echo 'TEST-1 FAILED'; fi;\
+    report "export http_proxy=$http_proxy;\
+        if curl -o test.html www.baidu.com > /dev/null; then echo 'TEST-1 OK'; else echo 'TEST-1 FAILED'; fi;\
     if curl -i -r 0-1024 http://www.sina.com.cn -o sina_part1.html > /dev/null; then echo 'TEST-2 OK'; else echo 'TEST-2 FAILED'; fi;\
     if curl -v www.baidu.com > /dev/null; then echo 'TEST-3 OK'; else echo 'TEST-3 FAILED'; fi;\
     if curl -V > /dev/null; then echo 'TEST-4 OK'; else echo 'TEST-4 FAILED'; fi;\
Signature · 1 line
2.9.3.windows.3
#1 lore raw
Quoted 31 lines

-----Original Message-----
From: [email protected] [mailto:fuego- [email protected]] On Behalf Of Song Cai
Sent: Friday, October 13, 2017 3:05 AM
To: [email protected]
Subject: [Fuego] [PATCH 02/18] add http proxy

add http proxy for curl

---
 engine/tests/Functional.curl/fuego_test.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
engine/tests/Functional.curl/fuego_test.sh +2 -1
index 90d24dd..5f8d71a 100755
@@ -1,5 +1,6 @@
 function test_run {
-    report "if curl -o test.html www.baidu.com > /dev/null; then echo 'TEST-1
 OK'; else echo 'TEST-1 FAILED'; fi;\
+    report "export http_proxy=$http_proxy;\
+        if curl -o test.html www.baidu.com > /dev/null; then echo 'TEST-1 OK';
 else echo 'TEST-1 FAILED'; fi;\
     if curl -i -r 0-1024 http://www.sina.com.cn -o sina_part1.html > /dev/null;

then echo 'TEST-2 OK'; else echo 'TEST-2 FAILED'; fi;\
if curl -v www.baidu.com > /dev/null; then echo 'TEST-3 OK'; else echo

Quoted 5 lines
'TEST-3 FAILED'; fi;\
     if curl -V > /dev/null; then echo 'TEST-4 OK'; else echo 'TEST-4 FAILED'; fi;\

--
2.9.3.windows.3

This applies the proxy from the docker container onto the target, which may not be correct. We don't currently support it, but in the future we plan to support target boards operating on different networks than the host.

I think the board should have its own proxy set up correctly, and not rely on the test to set it. That is, why isn't http_proxy already set in the board's environment? (and thus the fuego test account gets that setting when
it executes commands?) I'm willing to be convinced if there's a valid
use case for this, though.

It seems to me that testing that the environment required for curl (including the proxy setting) is actually part of the test.

For now, NAK.
-- Tim