File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -633,5 +633,39 @@ remove_sync_container
633
633
wait
634
634
pass
635
635
636
+ # Test http handler
637
+ testcase " http"
638
+ # First sync
639
+ echo " $TESTCASE 1" > " $REPO " /file
640
+ expected_depth=" 1"
641
+ git -C " $REPO " commit -qam " $TESTCASE 1"
642
+ GIT_SYNC \
643
+ --logtostderr \
644
+ --v=5 \
645
+ --repo=" $REPO " \
646
+ --depth=" $expected_depth " \
647
+ --root=" $ROOT " \
648
+ --http-bind=" :8888" \
649
+ --http-metrics \
650
+ --http-pprof \
651
+ --dest=" link" > " $DIR " /log." $TESTCASE " 2>&1 &
652
+ sleep 2
653
+ # check that health endpoint is alive
654
+ if [[ $( curl --write-out %{http_code} --silent --output /dev/null http://localhost:8888) -ne 200 ]] ; then
655
+ fail " health endpoint failed"
656
+ fi
657
+ # check that the metrics endpoint exists
658
+ if [[ $( curl --write-out %{http_code} --silent --output /dev/null http://localhost:8888/metrics) -ne 200 ]] ; then
659
+ fail " metrics endpoint failed"
660
+ fi
661
+ # check that the pprof endpoint exists
662
+ if [[ $( curl --write-out %{http_code} --silent --output /dev/null http://localhost:8888/debug/pprof/) -ne 200 ]] ; then
663
+ fail " pprof endpoint failed"
664
+ fi
665
+ # Wrap up
666
+ remove_sync_container
667
+ wait
668
+ pass
669
+
636
670
echo " cleaning up $DIR "
637
671
rm -rf " $DIR "
You can’t perform that action at this time.
0 commit comments