5
# Copyright (C) 2016 Canonical
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
23
from ubuntu_system_tests.common import (
28
DEFAULT_TEST_TIMEOUT = '1200' # 20 minutes.
31
def get_artifacts_directory():
32
"""Returns path to the directory in which results should be written to."""
33
return os.environ.get('ADT_ARTIFACTS')
36
def build_autopilot_command_list(config_stack):
37
"""Return a list containing the base autopilot command to run."""
38
test_config_string = config.get_test_config_values(config_stack)
55
def append_subunit_results(destination_file_path, results_file_path):
56
"""Append the subunit results into another subunit file."""
57
with open(destination_file_path, 'ab') as destination_file:
58
with open(results_file_path, 'rb') as results_file:
59
destination_file.write(results_file.read())
62
def ensure_keyfile_deleted():
63
"""Delete the keypair file after the tests are executed"""
64
ssh.ensure_device_keyfile_deleted()