$ python3 -m tests.cloud_tests run -p nocloud-kvm -n xenial -t modules/write_files -v
2017-11-03 18:45:53,046 - tests.cloud_tests - DEBUG - running with args: Namespace(data_dir=None, deb=None, feature_override={}, os_name=['xenial'], platform=['nocloud-kvm'], ppa=None, preserve_data=False, quiet=False, repo=None, result=None, rpm=None, script=None, subcmd='run', test_config=['/tmp/cloud-init/tests/cloud_tests/testcases/modules/write_files.yaml'], upgrade=False, upgrade_full=False, verbose=True)
2017-11-03 18:45:53,046 - tests.cloud_tests - DEBUG - using tmpdir: /tmp/cloud_test_data_op6m3hwz
2017-11-03 18:45:53,058 - tests.cloud_tests - DEBUG - platform config: {'enabled': True, 'get_image_timeout': 300, 'create_instance_timeout': 60, 'private_key': 'id_rsa', 'public_key': 'id_rsa.pub', 'data_dir': '/tmp/cloud_test_data_op6m3hwz'}
2017-11-03 18:45:53,058 - tests.cloud_tests - INFO - setting up platform: nocloud-kvm
2017-11-03 18:45:53,081 - tests.cloud_tests - DEBUG - os config: {'enabled': True, 'boot_timeout': 120, 'boot_clean_script': '#!/bin/bash\nrm -rf /var/log/cloud-init.log /var/log/cloud-init-output.log \\\n /var/lib/cloud/ /run/cloud-init/ /var/log/syslog\n', 'system_ready_script': "# permit running or degraded state as both indicate complete boot\n[ $(systemctl is-system-running) = 'running' -o\n $(systemctl is-system-running) = 'degraded' ]\n", 'cloud_init_ready_script': "[ -f '/run/cloud-init/result.json' ]\n", 'feature_groups': ['base', 'debian_base', 'ubuntu_specific'], 'features': {'apt': True, 'byobu': True, 'landscape': True, 'lxd': True, 'ppa': True, 'rpm': None, 'snap': True, 'hostname': True, 'apt_src_cont': True, 'apt_hist_fmt': True, 'daylight_time': True, 'apt_up_out': True, 'engb_locale': True, 'locale_gen': True, 'no_ntpdate': True, 'no_file_fmt_e': True, 'ppa_file_name': True, 'sshd': True, 'ssh_key_fmt': True, 'syslog': True, 'ubuntu_ntp': True, 'ubuntu_repos': True, 'ubuntu_user': True, 'lsb_release': True, 'sudo': True}, 'mirror_url': 'https://cloud-images.ubuntu.com/daily', 'mirror_dir': '/srv/citest/nocloud-kvm', 'keyring': '/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg', 'setup_overrides': None, 'override_templates': False, 'release': 'xenial', 'version': 16.04, 'family': 'ubuntu', 'arch': 'amd64'}
2017-11-03 18:45:53,081 - tests.cloud_tests - INFO - acquiring image for os: xenial
2017-11-03 18:46:02,772 - tests.cloud_tests - DEBUG - updating args for setup with: None
2017-11-03 18:46:02,773 - tests.cloud_tests - INFO - setting up ubuntu-xenial
2017-11-03 18:46:02,773 - tests.cloud_tests - DEBUG - execute (query version for package: cloud-init): dpkg-query -W '--showformat=${Version}' cloud-init
2017-11-03 18:46:03,088 - tests.cloud_tests - DEBUG - after setup complete, installed cloud-init version is: b'0.7.9-233-ge586fe35-0ubuntu1~16.04.2'
2017-11-03 18:46:03,089 - tests.cloud_tests - INFO - generating SSH keys
2017-11-03 18:46:03,443 - tests.cloud_tests - DEBUG - creating snapshot for xenial
2017-11-03 18:46:03,454 - tests.cloud_tests - INFO - collecting test data for os: xenial
2017-11-03 18:46:03,458 - tests.cloud_tests - INFO - collecting test data for test: modules/write_files
2017-11-03 18:46:04,480 - tests.cloud_tests - DEBUG - execute: sh -c 'i=0; while [ $i -lt 120 ] && i=$(($i+1)); do [ $(systemctl is-system-running) = '"'"'running'"'"' -o $(systemctl is-system-running) = '"'"'degraded'"'"' ] && [ -f '"'"'/run/cloud-init/result.json'"'"' ] && exit 0; sleep 1; done; exit 1'
2017-11-03 18:46:32,394 - tests.cloud_tests - DEBUG - running collect script: cloud-init.log
2017-11-03 18:46:32,394 - tests.cloud_tests - DEBUG - execute (collect: cloud-init.log): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0000
2017-11-03 18:46:52,493 - tests.cloud_tests - DEBUG - running collect script: cloud-init-output.log
2017-11-03 18:46:52,493 - tests.cloud_tests - DEBUG - execute (collect: cloud-init-output.log): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0001
2017-11-03 18:47:12,681 - tests.cloud_tests - DEBUG - running collect script: instance-id
2017-11-03 18:47:12,681 - tests.cloud_tests - DEBUG - execute (collect: instance-id): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0002
2017-11-03 18:47:32,887 - tests.cloud_tests - DEBUG - running collect script: result.json
2017-11-03 18:47:32,888 - tests.cloud_tests - DEBUG - execute (collect: result.json): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0003
2017-11-03 18:47:53,152 - tests.cloud_tests - DEBUG - running collect script: status.json
2017-11-03 18:47:53,152 - tests.cloud_tests - DEBUG - execute (collect: status.json): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0004
2017-11-03 18:48:13,384 - tests.cloud_tests - DEBUG - running collect script: cloud-init-version
2017-11-03 18:48:13,384 - tests.cloud_tests - DEBUG - execute (collect: cloud-init-version): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0005
2017-11-03 18:48:33,603 - tests.cloud_tests - DEBUG - running collect script: file_b64
2017-11-03 18:48:33,603 - tests.cloud_tests - DEBUG - execute (collect: file_b64): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0006
2017-11-03 18:48:53,841 - tests.cloud_tests - DEBUG - running collect script: file_text
2017-11-03 18:48:53,841 - tests.cloud_tests - DEBUG - execute (collect: file_text): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0007
2017-11-03 18:49:14,095 - tests.cloud_tests - DEBUG - running collect script: file_binary
2017-11-03 18:49:14,096 - tests.cloud_tests - DEBUG - execute (collect: file_binary): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0008
2017-11-03 18:49:34,295 - tests.cloud_tests - DEBUG - running collect script: file_gzip
2017-11-03 18:49:34,295 - tests.cloud_tests - DEBUG - execute (collect: file_gzip): sh -c 'set -e; s="$1"; shift; cat > "$s"; trap "rm -f $s" EXIT; chmod +x "$s"; "$s" "$@"' runscript /tmp/NoCloudKVMInstance-0009
2017-11-03 18:49:54,495 - tests.cloud_tests - DEBUG - getting console log
2017-11-03 18:49:54,500 - tests.cloud_tests - DEBUG - collect stages: {'name': 'collect data', 'time': 241.4538824558258, 'errors': [], 'stages': [{'name': 'collect for platform: nocloud-kvm', 'time': 241.44207572937012, 'errors': [], 'stages': [{'name': 'set up and collect data for os: xenial', 'time': 231.72752380371094, 'errors': [], 'stages': [{'name': 'set up for ubuntu-xenial', 'time': 7.152557373046875e-07, 'errors': [], 'stages': [], 'success': True}, {'name': 'collect test data for xenial', 'time': 231.0454294681549, 'errors': [], 'stages': [{'name': 'collect for test: modules/write_files', 'time': 231.02744340896606, 'errors': [], 'stages': [{'name': 'boot instance', 'time': 28.925546407699585, 'errors': [], 'success': True}, {'name': 'script cloud-init.log', 'time': 20.098788499832153, 'errors': [], 'success': True}, {'name': 'script cloud-init-output.log', 'time': 20.18780255317688, 'errors': [], 'success': True}, {'name': 'script instance-id', 'time': 20.206466913223267, 'errors': [], 'success': True}, {'name': 'script result.json', 'time': 20.265126943588257, 'errors': [], 'success': True}, {'name': 'script status.json', 'time': 20.23154067993164, 'errors': [], 'success': True}, {'name': 'script cloud-init-version', 'time': 20.21949601173401, 'errors': [], 'success': True}, {'name': 'script file_b64', 'time': 20.23725914955139, 'errors': [], 'success': True}, {'name': 'script file_text', 'time': 20.25455665588379, 'errors': [], 'success': True}, {'name': 'script file_binary', 'time': 20.199816703796387, 'errors': [], 'success': True}, {'name': 'script file_gzip', 'time': 20.200538158416748, 'errors': [], 'success': True}, {'name': 'collect console', 'time': 0.000286102294921875, 'errors': [], 'success': True}], 'success': True}], 'success': True}], 'success': True}], 'success': True}], 'success': True}
2017-11-03 18:49:54,501 - tests.cloud_tests - DEBUG - found test data: {'nocloud-kvm': {'xenial': ['modules/write_files']}}
2017-11-03 18:49:54,501 - tests.cloud_tests - INFO - test: platform='nocloud-kvm', os='xenial' verifying test data
2017-11-03 18:49:54,501 - tests.cloud_tests - DEBUG - verifying test data for modules/write_files
test_b64 (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Test b64 encoded file reads as ascii. ... ok
test_binary (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Test binary file reads as executable. ... ok
test_gzip (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Test gzip file shows up as a shell script. ... ok
test_no_stages_errors (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Ensure that there were no errors in any stage. ... ok
test_no_warnings_in_log (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Warnings should not be found in the log. ... ok
test_text (tests.cloud_tests.testcases.modules.write_files.TestWriteFiles)
Test text shows up as ASCII text. ... ok
----------------------------------------------------------------------
Ran 6 tests in 0.001s
OK
2017-11-03 18:49:54,508 - tests.cloud_tests - INFO - test: platform='nocloud-kvm', os='xenial' passed all tests
2017-11-03 18:49:54,508 - tests.cloud_tests - DEBUG - verify results: {'nocloud-kvm': {'xenial': {'modules/write_files': {'passed': True, 'failures': []}}}}