1-- Copyright 2014 The Kyua Authors. 2-- All rights reserved. 3-- 4-- Redistribution and use in source and binary forms, with or without 5-- modification, are permitted provided that the following conditions are 6-- met: 7-- 8-- * Redistributions of source code must retain the above copyright 9-- notice, this list of conditions and the following disclaimer. 10-- * Redistributions in binary form must reproduce the above copyright 11-- notice, this list of conditions and the following disclaimer in the 12-- documentation and/or other materials provided with the distribution. 13-- * Neither the name of Google Inc. nor the names of its contributors 14-- may be used to endorse or promote products derived from this software 15-- without specific prior written permission. 16-- 17-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29-- \file store/testdata_v3.sql 30-- Populates a v3 database with some test data. 31-- 32-- Mixture of test programs. 33 34 35BEGIN TRANSACTION; 36 37 38-- context 39INSERT INTO contexts (cwd) VALUES ('/usr/tests'); 40INSERT INTO env_vars (var_name, var_value) 41 VALUES ('LANG', 'C'); 42INSERT INTO env_vars (var_name, var_value) 43 VALUES ('PATH', '/bin:/usr/bin'); 44INSERT INTO env_vars (var_name, var_value) 45 VALUES ('TERM', 'xterm'); 46 47-- metadata_id 12 48INSERT INTO metadatas VALUES (12, 'allowed_architectures', ''); 49INSERT INTO metadatas VALUES (12, 'allowed_platforms', ''); 50INSERT INTO metadatas VALUES (12, 'description', ''); 51INSERT INTO metadatas VALUES (12, 'has_cleanup', 'false'); 52INSERT INTO metadatas VALUES (12, 'required_configs', ''); 53INSERT INTO metadatas VALUES (12, 'required_files', ''); 54INSERT INTO metadatas VALUES (12, 'required_memory', '0'); 55INSERT INTO metadatas VALUES (12, 'required_programs', ''); 56INSERT INTO metadatas VALUES (12, 'required_user', ''); 57INSERT INTO metadatas VALUES (12, 'timeout', '10'); 58 59-- test_program_id 8 60INSERT INTO test_programs (test_program_id, absolute_path, root, 61 relative_path, test_suite_name, metadata_id, 62 interface) 63 VALUES (8, '/usr/tests/subdir/another_test', '/usr/tests', 64 'subdir/another_test', 'subsuite-name', 12, 'plain'); 65 66-- test_case_id 10 67INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 68 VALUES (10, 8, 'main', 12); 69INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 70 end_time) 71 VALUES (10, 'failed', 'Exit failure', 1357644395000000, 1357644396000000); 72 73-- file_id 5 74INSERT INTO files (file_id, contents) VALUES (5, x'54657374207374646f7574'); 75INSERT INTO test_case_files (test_case_id, file_name, file_id) 76 VALUES (10, '__STDOUT__', 5); 77 78-- file_id 6 79INSERT INTO files (file_id, contents) VALUES (6, x'5465737420737464657272'); 80INSERT INTO test_case_files (test_case_id, file_name, file_id) 81 VALUES (10, '__STDERR__', 6); 82 83-- metadata_id 13 84INSERT INTO metadatas VALUES (13, 'allowed_architectures', ''); 85INSERT INTO metadatas VALUES (13, 'allowed_platforms', ''); 86INSERT INTO metadatas VALUES (13, 'description', ''); 87INSERT INTO metadatas VALUES (13, 'has_cleanup', 'false'); 88INSERT INTO metadatas VALUES (13, 'required_configs', ''); 89INSERT INTO metadatas VALUES (13, 'required_files', ''); 90INSERT INTO metadatas VALUES (13, 'required_memory', '0'); 91INSERT INTO metadatas VALUES (13, 'required_programs', ''); 92INSERT INTO metadatas VALUES (13, 'required_user', ''); 93INSERT INTO metadatas VALUES (13, 'timeout', '300'); 94 95-- test_program_id 9 96INSERT INTO test_programs (test_program_id, absolute_path, root, 97 relative_path, test_suite_name, metadata_id, 98 interface) 99 VALUES (9, '/usr/tests/complex_test', '/usr/tests', 100 'complex_test', 'suite-name', 14, 'atf'); 101 102-- metadata_id 15 103INSERT INTO metadatas VALUES (15, 'allowed_architectures', ''); 104INSERT INTO metadatas VALUES (15, 'allowed_platforms', ''); 105INSERT INTO metadatas VALUES (15, 'description', ''); 106INSERT INTO metadatas VALUES (15, 'has_cleanup', 'false'); 107INSERT INTO metadatas VALUES (15, 'required_configs', ''); 108INSERT INTO metadatas VALUES (15, 'required_files', ''); 109INSERT INTO metadatas VALUES (15, 'required_memory', '0'); 110INSERT INTO metadatas VALUES (15, 'required_programs', ''); 111INSERT INTO metadatas VALUES (15, 'required_user', ''); 112INSERT INTO metadatas VALUES (15, 'timeout', '300'); 113 114-- test_case_id 11 115INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 116 VALUES (11, 9, 'this_passes', 15); 117INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 118 end_time) 119 VALUES (11, 'passed', NULL, 1357644396500000, 1357644397000000); 120 121-- metadata_id 16 122INSERT INTO metadatas VALUES (16, 'allowed_architectures', ''); 123INSERT INTO metadatas VALUES (16, 'allowed_platforms', ''); 124INSERT INTO metadatas VALUES (16, 'description', 'Test description'); 125INSERT INTO metadatas VALUES (16, 'has_cleanup', 'false'); 126INSERT INTO metadatas VALUES (16, 'required_configs', ''); 127INSERT INTO metadatas VALUES (16, 'required_files', ''); 128INSERT INTO metadatas VALUES (16, 'required_memory', '0'); 129INSERT INTO metadatas VALUES (16, 'required_programs', ''); 130INSERT INTO metadatas VALUES (16, 'required_user', 'root'); 131INSERT INTO metadatas VALUES (16, 'timeout', '300'); 132 133-- test_case_id 12 134INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 135 VALUES (12, 9, 'this_fails', 16); 136INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 137 end_time) 138 VALUES (12, 'failed', 'Some reason', 1357644397100000, 1357644399005000); 139 140 141COMMIT TRANSACTION; 142