1# Copyright 2020 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain 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, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14"""This module contains a list of test repository's used in unit/integration 15tests. 16 17Note: If you notice tests failing for unexpected reasons, make sure the data 18in the test repos are correct. This is because the test repos are dynamic and 19may change. 20 21Note: This should be removed when a better method of testing is established. 22""" 23 24import collections 25import os 26 27ExampleRepo = collections.namedtuple('ExampleRepo', [ 28 'project_name', 'oss_repo_name', 'git_repo_name', 'image_location', 29 'git_url', 'new_commit', 'old_commit', 'intro_commit', 'fuzz_target', 30 'test_case_path' 31]) 32 33TEST_DIR_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 34 'testcases') 35 36# WARNING: Tests are dependent upon the following repos existing and the 37# specified commits existing. 38# TODO(metzman): Fix this problem. 39TEST_REPOS = [ 40 ExampleRepo(project_name='curl', 41 oss_repo_name='curl', 42 git_repo_name='curl', 43 image_location='/src', 44 git_url='https://github.com/curl/curl.git', 45 old_commit='df26f5f9c36e19cd503c0e462e9f72ad37b84c82', 46 new_commit='dda418266c99ceab368d723facb52069cbb9c8d5', 47 intro_commit='df26f5f9c36e19cd503c0e462e9f72ad37b84c82', 48 fuzz_target='curl_fuzzer_ftp', 49 test_case_path=os.path.join(TEST_DIR_PATH, 'curl_test_data')), 50 ExampleRepo(project_name='libarchive', 51 oss_repo_name='libarchive', 52 git_repo_name='libarchive', 53 image_location='/src', 54 git_url='https://github.com/libarchive/libarchive.git', 55 old_commit='5bd2a9b6658a3a6efa20bb9ad75bd39a44d71da6', 56 new_commit='458e49358f17ec58d65ab1c45cf299baaf3c98d1', 57 intro_commit='840266712006de5e737f8052db920dfea2be4260', 58 fuzz_target='libarchive_fuzzer', 59 test_case_path=os.path.join(TEST_DIR_PATH, 60 'libarchive_test_data')), 61 ExampleRepo(project_name='gonids', 62 oss_repo_name='gonids', 63 git_repo_name='gonids', 64 image_location='/root/go/src/github.com/google/', 65 git_url='https://github.com/google/gonids', 66 old_commit='', 67 new_commit='', 68 intro_commit='', 69 fuzz_target='', 70 test_case_path='') 71] 72 73INVALID_REPO = ExampleRepo(project_name='notaproj', 74 oss_repo_name='notarepo', 75 git_repo_name='notarepo', 76 git_url='invalid.git', 77 image_location='/src', 78 old_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 79 new_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 80 intro_commit='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 81 fuzz_target='NONEFUZZER', 82 test_case_path='not/a/path') 83