3 if [ -z "$PYARTIPROXY_IP" ];then
5 echo "DEBUG: No PYARTIPROXY_IP variable, using fallbacks"
7 AGLCORELAB_IP=192.168.111.1
9 if ping -q -W 2 -4 -c 1 $BAYLIBRE_IP ; then
10 PYARTIPROXY_IP=$BAYLIBRE_IP
12 if ping -q -W 2 -4 -c 1 $AGLCORELAB_IP ; then
13 PYARTIPROXY_IP=$AGLCORELAB_IP
15 if [ -z $PYARTIPROXY_IP ] ; then
16 echo "ERROR: no PYARTIPROXY_IP"
22 echo "ERROR: missing path argument"
27 echo "ERROR: missing filename argument"
32 echo "ERROR: $1 is a directory"
36 echo "DEBUG: filename=$2 data=$1"
40 echo "DEBUG: $1 exists and not empty"
42 echo "WARNING: $1 is empty"
45 echo "ERROR: data does not exists"
48 curl --silent --show-error -F "filename=$2" -F "data=@$1" http://$PYARTIPROXY_IP:9090/cgi-bin/pyartiproxy.py --output curl.out
50 echo "ERROR: with curl"
51 # retry without silent
52 curl --show-error -F "filename=$2" -F "data=@$1" http://$PYARTIPROXY_IP:9090/cgi-bin/pyartiproxy.py --output curl.out
54 ARTI_URL=$(grep -E '^http://.*|https://.*' curl.out)
55 echo "==========================="
57 echo "==========================="
58 if [ -z "$ARTI_URL" ];then
59 # No URL something is wrong
60 lava-test-reference artifactory-$2 --result fail
63 lava-test-reference artifactory-$2 --result pass --reference $ARTI_URL