"Fossies" - the Fresh Open Source Software Archive

Member "incubator-pagespeed-mod-1.14.36.1/pagespeed/automatic/system_tests/add_instrumentation.sh" (28 Feb 2020, 1479 Bytes) of package /linux/www/apache_httpd_modules/incubator-pagespeed-mod-1.14.36.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "add_instrumentation.sh": 1.13.35.2_vs_1.14.36.1.

    1 #!/bin/bash
    2 #
    3 #
    4 # Licensed under the Apache License, Version 2.0 (the "License");
    5 # you may not use this file except in compliance with the License.
    6 # You may obtain a copy of the License at
    7 #
    8 #      http://www.apache.org/licenses/LICENSE-2.0
    9 #
   10 # Unless required by applicable law or agreed to in writing, software
   11 # distributed under the License is distributed on an "AS IS" BASIS,
   12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   13 # See the License for the specific language governing permissions and
   14 # limitations under the License.
   15 test_filter add_instrumentation adds 2 script tags
   16 check run_wget_with_args $URL
   17 # Counts occurances of '<script' in $FETCHED
   18 # See: http://superuser.com/questions/339522
   19 check [ $(fgrep -o '<script' $FETCHED | wc -l) -eq 2 ]
   20 
   21 start_test "We don't add_instrumentation if URL params tell us not to"
   22 FILE=add_instrumentation.html?PageSpeedFilters=
   23 URL=$EXAMPLE_ROOT/$FILE
   24 FETCHED=$WGET_DIR/$FILE
   25 check run_wget_with_args $URL
   26 check [ $(fgrep -o '<script' $FETCHED | wc -l) -eq 0 ]
   27 
   28 # http://github.com/apache/incubator-pagespeed-mod/issues/170
   29 start_test "Make sure 404s aren't rewritten"
   30 # Note: We run this in the add_instrumentation section because that is the
   31 # easiest to detect which changes every page
   32 THIS_BAD_URL=$BAD_RESOURCE_URL?PageSpeedFilters=add_instrumentation
   33 # We use curl, because wget does not save 404 contents
   34 OUT=$($CURL --silent $THIS_BAD_URL)
   35 check_not_from "$OUT" fgrep "/mod_pagespeed_beacon"