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-- ATF test programs only. 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 ('PATH', '/bin:/usr/bin'); 42 43-- metadata_id 6 44INSERT INTO metadatas VALUES (6, 'allowed_architectures', ''); 45INSERT INTO metadatas VALUES (6, 'allowed_platforms', ''); 46INSERT INTO metadatas VALUES (6, 'description', ''); 47INSERT INTO metadatas VALUES (6, 'has_cleanup', 'false'); 48INSERT INTO metadatas VALUES (6, 'required_configs', ''); 49INSERT INTO metadatas VALUES (6, 'required_files', ''); 50INSERT INTO metadatas VALUES (6, 'required_memory', '0'); 51INSERT INTO metadatas VALUES (6, 'required_programs', ''); 52INSERT INTO metadatas VALUES (6, 'required_user', ''); 53INSERT INTO metadatas VALUES (6, 'timeout', '300'); 54 55-- test_program_id 6 56INSERT INTO test_programs (test_program_id, absolute_path, root, 57 relative_path, test_suite_name, metadata_id, 58 interface) 59 VALUES (6, '/usr/tests/complex_test', '/usr/tests', 60 'complex_test', 'suite-name', 6, 'atf'); 61 62-- metadata_id 7 63INSERT INTO metadatas VALUES (7, 'allowed_architectures', ''); 64INSERT INTO metadatas VALUES (7, 'allowed_platforms', ''); 65INSERT INTO metadatas VALUES (7, 'description', ''); 66INSERT INTO metadatas VALUES (7, 'has_cleanup', 'false'); 67INSERT INTO metadatas VALUES (7, 'required_configs', ''); 68INSERT INTO metadatas VALUES (7, 'required_files', ''); 69INSERT INTO metadatas VALUES (7, 'required_memory', '0'); 70INSERT INTO metadatas VALUES (7, 'required_programs', ''); 71INSERT INTO metadatas VALUES (7, 'required_user', ''); 72INSERT INTO metadatas VALUES (7, 'timeout', '300'); 73 74-- test_case_id 6, passed, no optional metadata. 75INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 76 VALUES (6, 6, 'this_passes', 7); 77INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 78 end_time) 79 VALUES (6, 'passed', NULL, 1357648712000000, 1357648718000000); 80 81-- metadata_id 8 82INSERT INTO metadatas VALUES (8, 'allowed_architectures', ''); 83INSERT INTO metadatas VALUES (8, 'allowed_platforms', ''); 84INSERT INTO metadatas VALUES (8, 'description', 'Test description'); 85INSERT INTO metadatas VALUES (8, 'has_cleanup', 'true'); 86INSERT INTO metadatas VALUES (8, 'required_configs', ''); 87INSERT INTO metadatas VALUES (8, 'required_files', ''); 88INSERT INTO metadatas VALUES (8, 'required_memory', '128'); 89INSERT INTO metadatas VALUES (8, 'required_programs', ''); 90INSERT INTO metadatas VALUES (8, 'required_user', 'root'); 91INSERT INTO metadatas VALUES (8, 'timeout', '300'); 92 93-- test_case_id 7, failed, optional non-multivalue metadata. 94INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 95 VALUES (7, 6, 'this_fails', 8); 96INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 97 end_time) 98 VALUES (7, 'failed', 'Some reason', 1357648719000000, 1357648720897182); 99 100-- metadata_id 9 101INSERT INTO metadatas VALUES (9, 'allowed_architectures', 'powerpc x86_64'); 102INSERT INTO metadatas VALUES (9, 'allowed_platforms', 'amd64 macppc'); 103INSERT INTO metadatas VALUES (9, 'description', 'Test explanation'); 104INSERT INTO metadatas VALUES (9, 'has_cleanup', 'true'); 105INSERT INTO metadatas VALUES (9, 'required_configs', 'unprivileged_user X-foo'); 106INSERT INTO metadatas VALUES (9, 'required_files', '/the/data/file'); 107INSERT INTO metadatas VALUES (9, 'required_memory', '512'); 108INSERT INTO metadatas VALUES (9, 'required_programs', 'cp /bin/ls'); 109INSERT INTO metadatas VALUES (9, 'required_user', 'unprivileged'); 110INSERT INTO metadatas VALUES (9, 'timeout', '600'); 111 112-- test_case_id 8, skipped, all optional metadata. 113INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 114 VALUES (8, 6, 'this_skips', 9); 115INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 116 end_time) 117 VALUES (8, 'skipped', 'Another reason', 1357648729182013, 1357648730000000); 118 119-- file_id 3 120INSERT INTO files (file_id, contents) 121 VALUES (3, x'416e6f74686572207374646f7574'); 122INSERT INTO test_case_files (test_case_id, file_name, file_id) 123 VALUES (8, '__STDOUT__', 3); 124 125-- metadata_id 10 126INSERT INTO metadatas VALUES (10, 'allowed_architectures', ''); 127INSERT INTO metadatas VALUES (10, 'allowed_platforms', ''); 128INSERT INTO metadatas VALUES (10, 'description', ''); 129INSERT INTO metadatas VALUES (10, 'has_cleanup', 'false'); 130INSERT INTO metadatas VALUES (10, 'required_configs', ''); 131INSERT INTO metadatas VALUES (10, 'required_files', ''); 132INSERT INTO metadatas VALUES (10, 'required_memory', '0'); 133INSERT INTO metadatas VALUES (10, 'required_programs', ''); 134INSERT INTO metadatas VALUES (10, 'required_user', ''); 135INSERT INTO metadatas VALUES (10, 'timeout', '300'); 136 137-- test_program_id 7 138INSERT INTO test_programs (test_program_id, absolute_path, root, 139 relative_path, test_suite_name, metadata_id, 140 interface) 141 VALUES (7, '/usr/tests/simple_test', '/usr/tests', 142 'simple_test', 'subsuite-name', 10, 'atf'); 143 144-- metadata_id 11 145INSERT INTO metadatas VALUES (11, 'allowed_architectures', ''); 146INSERT INTO metadatas VALUES (11, 'allowed_platforms', ''); 147INSERT INTO metadatas VALUES (11, 'description', 'More text'); 148INSERT INTO metadatas VALUES (11, 'has_cleanup', 'true'); 149INSERT INTO metadatas VALUES (11, 'required_configs', ''); 150INSERT INTO metadatas VALUES (11, 'required_files', ''); 151INSERT INTO metadatas VALUES (11, 'required_memory', '128'); 152INSERT INTO metadatas VALUES (11, 'required_programs', ''); 153INSERT INTO metadatas VALUES (11, 'required_user', 'unprivileged'); 154INSERT INTO metadatas VALUES (11, 'timeout', '300'); 155 156-- test_case_id 9 157INSERT INTO test_cases (test_case_id, test_program_id, name, metadata_id) 158 VALUES (9, 7, 'main', 11); 159INSERT INTO test_results (test_case_id, result_type, result_reason, start_time, 160 end_time) 161 VALUES (9, 'failed', 'Exited with code 1', 162 1357648740120000, 1357648750081700); 163 164-- file_id 4 165INSERT INTO files (file_id, contents) 166 VALUES (4, x'416e6f7468657220737464657272'); 167INSERT INTO test_case_files (test_case_id, file_name, file_id) 168 VALUES (9, '__STDERR__', 4); 169 170 171COMMIT TRANSACTION; 172