This is an automated email from the ASF dual-hosted git repository. rob pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit 17c82b3df38144fe43aedfd71509ae5781b4ac46 Author: Jan van Doorn <j...@knutsel.com> AuthorDate: Sat May 26 14:44:34 2018 -0600 Licenses and fixes --- grove/integration_test/Dockerfile | 23 ++++++++++---- grove/integration_test/compare_gets.go | 18 ++++++++++- grove/integration_test/setup-and-run.sh | 15 ++++++++++ .../tests/plugins/range_req_handler/test.sh | 35 ++++++++++++++++++++-- 4 files changed, 82 insertions(+), 9 deletions(-) diff --git a/grove/integration_test/Dockerfile b/grove/integration_test/Dockerfile index 84d43cb..2ac6987 100644 --- a/grove/integration_test/Dockerfile +++ b/grove/integration_test/Dockerfile @@ -1,9 +1,22 @@ -FROM centos:7 -MAINTAINER The CentOS Project <cloud-...@centos.org> -LABEL Vendor="CentOS" \ - License=GPLv2 \ - Version=2.4.6-40 +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +FROM centos:7 RUN yum -y --setopt=tsflags=nodocs update && \ yum -y --setopt=tsflags=nodocs install httpd && \ diff --git a/grove/integration_test/compare_gets.go b/grove/integration_test/compare_gets.go index 5eeab70..b88cb69 100644 --- a/grove/integration_test/compare_gets.go +++ b/grove/integration_test/compare_gets.go @@ -1,5 +1,19 @@ package main +/* + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + import ( "flag" "fmt" @@ -106,6 +120,8 @@ func compareResponses(response1 responseType, response2 responseType, ignoreHdrs if ignoreMPB { contentTypeHdr := response1.Headers.Get("Content-type") + ignoreHdrs = append(ignoreHdrs, "Content-Type") // the boundary will be different + ignoreHdrs = append(ignoreHdrs, "Content-Length") // the boundary will be different //fmt.Println("ignoreing", contentTypeHdr, response1) if strings.HasPrefix(contentTypeHdr, "multipart/byteranges") { parts := strings.Split(contentTypeHdr, "=") @@ -145,7 +161,7 @@ func main() { orgHdrs := flag.String("ohdrs", "", "Comma seperated list of headers to add to origin request") cacheHdrs := flag.String("chdrs", "", "Comma separated list of headers to add to cache request") ignoreHdrs := flag.String("ignorehdrs", "Server,Date", "Comma separated list of headers to ignore in the compare") - ignoreMultiPartBoundary := flag.Bool("ignorembp", true, "Ignore multi part boundary in body comparison.") + ignoreMultiPartBoundary := flag.Bool("ignorempb", true, "Ignore multi part boundary in body comparison.") flag.Parse() resp := httpGet(*originURL+"/"+*path, *orgHdrs) diff --git a/grove/integration_test/setup-and-run.sh b/grove/integration_test/setup-and-run.sh index c9abf6b..4e642df 100644 --- a/grove/integration_test/setup-and-run.sh +++ b/grove/integration_test/setup-and-run.sh @@ -1,4 +1,19 @@ #!/usr/bin/bash + +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + echo Configuring Grove Integration Test Environment. #perl -v diff --git a/grove/integration_test/tests/plugins/range_req_handler/test.sh b/grove/integration_test/tests/plugins/range_req_handler/test.sh index 1908850..3de2d23 100644 --- a/grove/integration_test/tests/plugins/range_req_handler/test.sh +++ b/grove/integration_test/tests/plugins/range_req_handler/test.sh @@ -1,5 +1,20 @@ #!/usr/bin/env bash -x +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +CMP_TOOL="${CMP_TOOL:-/compare_gets}" + #curl -H'Host: mem-test.cdn.kabletown.net' -Lsv -r 50000-50009 http://localhost:8080/10Mb.txt originurl="http://localhost/" host="mem-test.cdn.kabletown.net" @@ -11,18 +26,32 @@ testno=0 for host in "mem-test.cdn.kabletown.net" "disk-test.cdn.kabletown.net" do - for r in "0-0" "0-100" "5000-" "-100" "0-010-15" "0-100200-210" "33-9966-88" "-" + for r in "0-0" "0-100" "5000-" "-100" do - test="/compare_gets --chdrs \"Host:$host Range:bytes=${r}\" --ohdrs \"Range:bytes=${r}\" --path \"10Mb.txt\" --ignorehdrs \"Server,Date\"" + test="${CMP_TOOL} --chdrs \"Host:$host Range:bytes=${r}\" --ohdrs \"Range:bytes=${r}\" --path \"10Mb.txt\" --ignorehdrs \"Server,Date\"" testno=$(($testno+1)) echo -n "Test $testno ($test): " - /compare_gets --chdrs "Host:$host Range:bytes=${r}" --ohdrs "Range:bytes=${r}" --path "10Mb.txt" --ignorehdrs "Server,Date" + ${CMP_TOOL} --chdrs "Host:$host Range:bytes=${r}" --ohdrs "Range:bytes=${r}" --path "10Mb.txt" --ignorehdrs "Server,Date" result=$(($result+$?)) done done +# multipart +for host in "mem-test.cdn.kabletown.net" "disk-test.cdn.kabletown.net" +do + for r in "0-0" "0-100" "5000-" "-100" "0-0,10-15" "0-100,200-210" "33-99,101-188" + do + test="${CMP_TOOL} --chdrs \"Host:$host Range:bytes=${r}\" --ohdrs \"Range:bytes=${r}\" --path \"10Mb.txt\" --ignorehdrs \"Server,Date\" --ignorempb" + testno=$(($testno+1)) + echo -n "Test $testno ($test): " + + ${CMP_TOOL} --chdrs "Host:$host Range:bytes=${r}" --ohdrs "Range:bytes=${r}" --path "10Mb.txt" --ignorehdrs "Server,Date" --ignorempb + + result=$(($result+$?)) + done +done echo "$testno tests done, $result failed." -- To stop receiving notification emails like this one, please contact r...@apache.org.