| Dongcan Ye | 6381395 | 2017-11-18 14:22:25 +0800 | [diff] [blame] | 1 | #! /bin/sh | 
|  | 2 | # | 
|  | 3 | #    Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 4 | #    not use this file except in compliance with the License. You may obtain | 
|  | 5 | #    a copy of the License at | 
|  | 6 | # | 
|  | 7 | #         http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 8 | # | 
|  | 9 | #    Unless required by applicable law or agreed to in writing, software | 
|  | 10 | #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 11 | #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 
|  | 12 | #    License for the specific language governing permissions and limitations | 
|  | 13 | #    under the License. | 
|  | 14 |  | 
|  | 15 | TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX` || exit 1 | 
|  | 16 | export TMPDIR | 
|  | 17 | trap "rm -rf $TMPDIR" EXIT | 
|  | 18 |  | 
|  | 19 | FAILURES=$TMPDIR/failures | 
|  | 20 |  | 
|  | 21 | check_no_duplicate_api_test_idempotent_ids() { | 
|  | 22 | # For API tests, an idempotent ID is assigned to each single API test, | 
|  | 23 | # those IDs should be unique | 
|  | 24 | output=$(check-uuid --package neutron_tempest_plugin) | 
|  | 25 | if [ "$?" -ne 0 ]; then | 
|  | 26 | echo "There are duplicate idempotent ids in the API tests" >>$FAILURES | 
|  | 27 | echo "please, assign unique uuids to each API test:" >>$FAILURES | 
|  | 28 | echo "$output" >>$FAILURES | 
|  | 29 | fi | 
|  | 30 | } | 
|  | 31 |  | 
|  | 32 | check_no_duplicate_api_test_idempotent_ids | 
|  | 33 |  | 
|  | 34 | # Fail, if there are emitted failures | 
|  | 35 | if [ -f $FAILURES ]; then | 
|  | 36 | cat $FAILURES | 
|  | 37 | exit 1 | 
|  | 38 | fi |