1*b0d29bc4SBrooks Davis-- Copyright 2014 The Kyua Authors. 2*b0d29bc4SBrooks Davis-- All rights reserved. 3*b0d29bc4SBrooks Davis-- 4*b0d29bc4SBrooks Davis-- Redistribution and use in source and binary forms, with or without 5*b0d29bc4SBrooks Davis-- modification, are permitted provided that the following conditions are 6*b0d29bc4SBrooks Davis-- met: 7*b0d29bc4SBrooks Davis-- 8*b0d29bc4SBrooks Davis-- * Redistributions of source code must retain the above copyright 9*b0d29bc4SBrooks Davis-- notice, this list of conditions and the following disclaimer. 10*b0d29bc4SBrooks Davis-- * Redistributions in binary form must reproduce the above copyright 11*b0d29bc4SBrooks Davis-- notice, this list of conditions and the following disclaimer in the 12*b0d29bc4SBrooks Davis-- documentation and/or other materials provided with the distribution. 13*b0d29bc4SBrooks Davis-- * Neither the name of Google Inc. nor the names of its contributors 14*b0d29bc4SBrooks Davis-- may be used to endorse or promote products derived from this software 15*b0d29bc4SBrooks Davis-- without specific prior written permission. 16*b0d29bc4SBrooks Davis-- 17*b0d29bc4SBrooks Davis-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18*b0d29bc4SBrooks Davis-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19*b0d29bc4SBrooks Davis-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20*b0d29bc4SBrooks Davis-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21*b0d29bc4SBrooks Davis-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22*b0d29bc4SBrooks Davis-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23*b0d29bc4SBrooks Davis-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24*b0d29bc4SBrooks Davis-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25*b0d29bc4SBrooks Davis-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26*b0d29bc4SBrooks Davis-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27*b0d29bc4SBrooks Davis-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28*b0d29bc4SBrooks Davis 29*b0d29bc4SBrooks Davis-- \file store/testdata_v3.sql 30*b0d29bc4SBrooks Davis-- Populates a v3 database with some test data. 31*b0d29bc4SBrooks Davis-- 32*b0d29bc4SBrooks Davis-- ATF test programs only. 33*b0d29bc4SBrooks Davis 34*b0d29bc4SBrooks Davis 35*b0d29bc4SBrooks DavisBEGIN TRANSACTION; 36*b0d29bc4SBrooks Davis 37*b0d29bc4SBrooks Davis 38*b0d29bc4SBrooks Davis-- context 39*b0d29bc4SBrooks DavisINSERT INTO contexts (cwd) VALUES ('/usr/tests'); 40*b0d29bc4SBrooks DavisINSERT INTO env_vars (var_name, var_value) 41*b0d29bc4SBrooks Davis VALUES ('PATH', '/bin:/usr/bin'); 42*b0d29bc4SBrooks Davis 43*b0d29bc4SBrooks Davis-- metadata_id 6 44*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'allowed_architectures', ''); 45*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'allowed_platforms', ''); 46*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'description', ''); 47*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'has_cleanup', 'false'); 48*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'required_configs', ''); 49*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'required_files', ''); 50*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'required_memory', '0'); 51*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'required_programs', ''); 52*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'required_user', ''); 53*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (6, 'timeout', '300'); 54*b0d29bc4SBrooks Davis 55*b0d29bc4SBrooks Davis-- test_program_id 6 56*b0d29bc4SBrooks DavisINSERT INTO test_programs (test_program_id, absolute_path, root, 57*b0d29bc4SBrooks Davis relative_path, test_suite_name, metadata_id, 58*b0d29bc4SBrooks Davis interface) 59*b0d29bc4SBrooks Davis VALUES (6, '/usr/tests/complex_test', '/usr/tests', 60*b0d29bc4SBrooks Davis 'complex_test', 'suite-name', 6, 'atf'); 61*b0d29bc4SBrooks Davis 62*b0d29bc4SBrooks Davis-- metadata_id 7 63*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'allowed_architectures', ''); 64*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'allowed_platforms', ''); 65*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'description', ''); 66*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'has_cleanup', 'false'); 67*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'required_configs', ''); 68*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'required_files', ''); 69*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'required_memory', '0'); 70*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'required_programs', ''); 71*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'required_user', ''); 72*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (7, 'timeout', '300'); 73*b0d29bc4SBrooks Davis 74*b0d29bc4SBrooks Davis-- test_case_id 6, passed, no optional metadata. 75*b0d29bc4SBrooks DavisINSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 76*b0d29bc4SBrooks Davis VALUES (6, 6, 'this_passes', 7); 77*b0d29bc4SBrooks DavisINSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 78*b0d29bc4SBrooks Davis end_time) 79*b0d29bc4SBrooks Davis VALUES (6, 'passed', NULL, 1357648712000000, 1357648718000000); 80*b0d29bc4SBrooks Davis 81*b0d29bc4SBrooks Davis-- metadata_id 8 82*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'allowed_architectures', ''); 83*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'allowed_platforms', ''); 84*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'description', 'Test description'); 85*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'has_cleanup', 'true'); 86*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'required_configs', ''); 87*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'required_files', ''); 88*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'required_memory', '128'); 89*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'required_programs', ''); 90*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'required_user', 'root'); 91*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (8, 'timeout', '300'); 92*b0d29bc4SBrooks Davis 93*b0d29bc4SBrooks Davis-- test_case_id 7, failed, optional non-multivalue metadata. 94*b0d29bc4SBrooks DavisINSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 95*b0d29bc4SBrooks Davis VALUES (7, 6, 'this_fails', 8); 96*b0d29bc4SBrooks DavisINSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 97*b0d29bc4SBrooks Davis end_time) 98*b0d29bc4SBrooks Davis VALUES (7, 'failed', 'Some reason', 1357648719000000, 1357648720897182); 99*b0d29bc4SBrooks Davis 100*b0d29bc4SBrooks Davis-- metadata_id 9 101*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'allowed_architectures', 'powerpc x86_64'); 102*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'allowed_platforms', 'amd64 macppc'); 103*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'description', 'Test explanation'); 104*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'has_cleanup', 'true'); 105*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'required_configs', 'unprivileged_user X-foo'); 106*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'required_files', '/the/data/file'); 107*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'required_memory', '512'); 108*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'required_programs', 'cp /bin/ls'); 109*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'required_user', 'unprivileged'); 110*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (9, 'timeout', '600'); 111*b0d29bc4SBrooks Davis 112*b0d29bc4SBrooks Davis-- test_case_id 8, skipped, all optional metadata. 113*b0d29bc4SBrooks DavisINSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 114*b0d29bc4SBrooks Davis VALUES (8, 6, 'this_skips', 9); 115*b0d29bc4SBrooks DavisINSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 116*b0d29bc4SBrooks Davis end_time) 117*b0d29bc4SBrooks Davis VALUES (8, 'skipped', 'Another reason', 1357648729182013, 1357648730000000); 118*b0d29bc4SBrooks Davis 119*b0d29bc4SBrooks Davis-- file_id 3 120*b0d29bc4SBrooks DavisINSERT INTO files (file_id, contents) 121*b0d29bc4SBrooks Davis VALUES (3, x'416e6f74686572207374646f7574'); 122*b0d29bc4SBrooks DavisINSERT INTO test_case_files (test_case_id, file_name, file_id) 123*b0d29bc4SBrooks Davis VALUES (8, '__STDOUT__', 3); 124*b0d29bc4SBrooks Davis 125*b0d29bc4SBrooks Davis-- metadata_id 10 126*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'allowed_architectures', ''); 127*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'allowed_platforms', ''); 128*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'description', ''); 129*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'has_cleanup', 'false'); 130*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'required_configs', ''); 131*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'required_files', ''); 132*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'required_memory', '0'); 133*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'required_programs', ''); 134*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'required_user', ''); 135*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (10, 'timeout', '300'); 136*b0d29bc4SBrooks Davis 137*b0d29bc4SBrooks Davis-- test_program_id 7 138*b0d29bc4SBrooks DavisINSERT INTO test_programs (test_program_id, absolute_path, root, 139*b0d29bc4SBrooks Davis relative_path, test_suite_name, metadata_id, 140*b0d29bc4SBrooks Davis interface) 141*b0d29bc4SBrooks Davis VALUES (7, '/usr/tests/simple_test', '/usr/tests', 142*b0d29bc4SBrooks Davis 'simple_test', 'subsuite-name', 10, 'atf'); 143*b0d29bc4SBrooks Davis 144*b0d29bc4SBrooks Davis-- metadata_id 11 145*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'allowed_architectures', ''); 146*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'allowed_platforms', ''); 147*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'description', 'More text'); 148*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'has_cleanup', 'true'); 149*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'required_configs', ''); 150*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'required_files', ''); 151*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'required_memory', '128'); 152*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'required_programs', ''); 153*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'required_user', 'unprivileged'); 154*b0d29bc4SBrooks DavisINSERT INTO metadatas VALUES (11, 'timeout', '300'); 155*b0d29bc4SBrooks Davis 156*b0d29bc4SBrooks Davis-- test_case_id 9 157*b0d29bc4SBrooks DavisINSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 158*b0d29bc4SBrooks Davis VALUES (9, 7, 'main', 11); 159*b0d29bc4SBrooks DavisINSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 160*b0d29bc4SBrooks Davis end_time) 161*b0d29bc4SBrooks Davis VALUES (9, 'failed', 'Exited with code 1', 162*b0d29bc4SBrooks Davis 1357648740120000, 1357648750081700); 163*b0d29bc4SBrooks Davis 164*b0d29bc4SBrooks Davis-- file_id 4 165*b0d29bc4SBrooks DavisINSERT INTO files (file_id, contents) 166*b0d29bc4SBrooks Davis VALUES (4, x'416e6f7468657220737464657272'); 167*b0d29bc4SBrooks DavisINSERT INTO test_case_files (test_case_id, file_name, file_id) 168*b0d29bc4SBrooks Davis VALUES (9, '__STDERR__', 4); 169*b0d29bc4SBrooks Davis 170*b0d29bc4SBrooks Davis 171*b0d29bc4SBrooks DavisCOMMIT TRANSACTION; 172