#!/bin/sh
# PCP QA Test No. 867
# Exercise libpcp_web HTTP client interfaces.
#
# Copyright (c) 2016,2019 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

_check_series

_cleanup()
{
    cd $here
    $sudo rm -rf \$tmp \$tmp.*
}

status=1	# failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "cd $here; _cleanup; exit \$status" 0 1 2 3 15

unset http_proxy
unset HTTP_PROXY

# real QA test starts here
_service pmproxy restart >/dev/null 2>&1

echo "== Check simple HTTP fetch" | tee -a $seq.full
$here/src/httpfetch "http://localhost:44323/series/ping" >> $seq.full 2>&1
[ $? -eq 0 ] && echo OK

# success, all done
status=0
exit
