From 76d58265e34851b78e952a7f275340863c90a9f5 Mon Sep 17 00:00:00 2001 From: Wesley Wiedenmeier Date: Thu, 8 Jun 2017 18:23:31 -0400 Subject: Integration Testing: tox env, pyxld 2.2.3, and revamp framework Massive update to clean up and greatly enhance the integration testing framework developed by Wesley Wiedenmeier. - Updated tox environment to run integration test 'citest' to utilize pylxd 2.2.3 - Add support for distro feature flags - add framework for feature flags to release config with feature groups and overrides allowed in any release conf override level - add support for feature flags in platform and config handling - during collect, skip testcases that require features not supported by the image with a warning message - Enable additional distros (i.e. centos, debian) - Add 'bddeb' command to build a deb from the current working tree cleanly in a container, so deps do not have to be installed on host - Adds a command line option '--preserve-data' that ensures that collected data will be left after tests run. This also allows the directory to store collected data in during the run command to be specified using '--data-dir'. - Updated Read the Docs testing page and doc strings for pep 257 compliance --- tests/cloud_tests/configs/modules/apt_configure_conf.yaml | 2 ++ .../configs/modules/apt_configure_disable_suites.yaml | 3 +++ tests/cloud_tests/configs/modules/apt_configure_primary.yaml | 7 +++++++ tests/cloud_tests/configs/modules/apt_configure_proxy.yaml | 2 ++ tests/cloud_tests/configs/modules/apt_configure_security.yaml | 3 +++ .../configs/modules/apt_configure_sources_key.yaml | 3 +++ .../configs/modules/apt_configure_sources_keyserver.yaml | 3 +++ .../configs/modules/apt_configure_sources_list.yaml | 3 +++ .../configs/modules/apt_configure_sources_ppa.yaml | 9 +++++++++ tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml | 2 ++ tests/cloud_tests/configs/modules/apt_pipelining_os.yaml | 2 ++ tests/cloud_tests/configs/modules/byobu.yaml | 2 ++ tests/cloud_tests/configs/modules/keys_to_console.yaml | 2 ++ tests/cloud_tests/configs/modules/landscape.yaml | 2 ++ tests/cloud_tests/configs/modules/locale.yaml | 3 +++ tests/cloud_tests/configs/modules/lxd_bridge.yaml | 2 ++ tests/cloud_tests/configs/modules/lxd_dir.yaml | 2 ++ tests/cloud_tests/configs/modules/ntp.yaml | 11 +++++++++++ tests/cloud_tests/configs/modules/ntp_pools.yaml | 10 ++++++++++ tests/cloud_tests/configs/modules/ntp_servers.yaml | 7 +++++++ .../configs/modules/package_update_upgrade_install.yaml | 11 +++++++++++ tests/cloud_tests/configs/modules/set_hostname.yaml | 2 ++ tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml | 2 ++ tests/cloud_tests/configs/modules/set_password.yaml | 2 ++ tests/cloud_tests/configs/modules/set_password_expire.yaml | 2 ++ tests/cloud_tests/configs/modules/snappy.yaml | 2 ++ .../configs/modules/ssh_auth_key_fingerprints_disable.yaml | 2 ++ .../configs/modules/ssh_auth_key_fingerprints_enable.yaml | 5 +++++ tests/cloud_tests/configs/modules/ssh_import_id.yaml | 3 +++ tests/cloud_tests/configs/modules/ssh_keys_generate.yaml | 2 ++ tests/cloud_tests/configs/modules/ssh_keys_provided.yaml | 3 +++ tests/cloud_tests/configs/modules/timezone.yaml | 2 ++ tests/cloud_tests/configs/modules/user_groups.yaml | 2 ++ tests/cloud_tests/configs/modules/write_files.yaml | 4 ++++ 34 files changed, 124 insertions(+) (limited to 'tests/cloud_tests/configs/modules') diff --git a/tests/cloud_tests/configs/modules/apt_configure_conf.yaml b/tests/cloud_tests/configs/modules/apt_configure_conf.yaml index 163ae3fc..de453000 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_conf.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_conf.yaml @@ -1,6 +1,8 @@ # # Provide a configuration for APT # +required_features: + - apt cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_disable_suites.yaml b/tests/cloud_tests/configs/modules/apt_configure_disable_suites.yaml index 73e4a538..98800673 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_disable_suites.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_disable_suites.yaml @@ -1,6 +1,9 @@ # # Disables everything in sources.list # +required_features: + - apt + - lsb_release cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_primary.yaml b/tests/cloud_tests/configs/modules/apt_configure_primary.yaml index 2ec30ca1..41bcf2fd 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_primary.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_primary.yaml @@ -1,6 +1,9 @@ # # Setup a custome primary sources.list # +required_features: + - apt + - apt_src_cont cloud_config: | #cloud-config apt: @@ -16,4 +19,8 @@ collect_scripts: #!/bin/bash grep -v '^#' /etc/apt/sources.list | sed '/^\s*$/d' | grep -c gtlib.gatech.edu + sources.list: | + #!/bin/bash + cat /etc/apt/sources.list + # vi: ts=4 expandtab diff --git a/tests/cloud_tests/configs/modules/apt_configure_proxy.yaml b/tests/cloud_tests/configs/modules/apt_configure_proxy.yaml index e7371305..be6c6f81 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_proxy.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_proxy.yaml @@ -1,6 +1,8 @@ # # Set apt proxy # +required_features: + - apt cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_security.yaml b/tests/cloud_tests/configs/modules/apt_configure_security.yaml index f6a2c828..83dd51df 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_security.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_security.yaml @@ -1,6 +1,9 @@ # # Add security to sources.list # +required_features: + - apt + - ubuntu_repos cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_sources_key.yaml b/tests/cloud_tests/configs/modules/apt_configure_sources_key.yaml index e7568a6a..bde9398a 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_sources_key.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_sources_key.yaml @@ -1,6 +1,9 @@ # # Add a sources.list entry with a given key (Debian Jessie) # +required_features: + - apt + - lsb_release cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml b/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml index 1a4a238f..11da61ea 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml @@ -1,6 +1,9 @@ # # Add a sources.list entry with a key from a keyserver # +required_features: + - apt + - lsb_release cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_sources_list.yaml b/tests/cloud_tests/configs/modules/apt_configure_sources_list.yaml index 057fc72c..143cb080 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_sources_list.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_sources_list.yaml @@ -1,6 +1,9 @@ # # Generate a sources.list # +required_features: + - apt + - lsb_release cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_configure_sources_ppa.yaml b/tests/cloud_tests/configs/modules/apt_configure_sources_ppa.yaml index dee9dc70..9efdae52 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_sources_ppa.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_sources_ppa.yaml @@ -1,6 +1,12 @@ # # Add a PPA to source.list # +# NOTE: on older ubuntu releases the sources file added is named +# 'curtin-dev-test-archive-trusty', without 'ubuntu' in the middle +required_features: + - apt + - ppa + - ppa_file_name cloud_config: | #cloud-config apt: @@ -16,5 +22,8 @@ collect_scripts: apt-key: | #!/bin/bash apt-key finger + sources_full: | + #!/bin/bash + cat /etc/apt/sources.list # vi: ts=4 expandtab diff --git a/tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml b/tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml index 5fa0cee9..bd9b5d08 100644 --- a/tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml +++ b/tests/cloud_tests/configs/modules/apt_pipelining_disable.yaml @@ -1,6 +1,8 @@ # # Disable apt pipelining value # +required_features: + - apt cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/apt_pipelining_os.yaml b/tests/cloud_tests/configs/modules/apt_pipelining_os.yaml index 87d183e7..cbed3ba3 100644 --- a/tests/cloud_tests/configs/modules/apt_pipelining_os.yaml +++ b/tests/cloud_tests/configs/modules/apt_pipelining_os.yaml @@ -1,6 +1,8 @@ # # Set apt pipelining value to OS # +required_features: + - apt cloud_config: | #cloud-config apt: diff --git a/tests/cloud_tests/configs/modules/byobu.yaml b/tests/cloud_tests/configs/modules/byobu.yaml index fd648c77..a9aa1f3f 100644 --- a/tests/cloud_tests/configs/modules/byobu.yaml +++ b/tests/cloud_tests/configs/modules/byobu.yaml @@ -1,6 +1,8 @@ # # Install and enable byobu system wide and default user # +required_features: + - byobu cloud_config: | #cloud-config byobu_by_default: enable diff --git a/tests/cloud_tests/configs/modules/keys_to_console.yaml b/tests/cloud_tests/configs/modules/keys_to_console.yaml index a90e42c1..5d86e739 100644 --- a/tests/cloud_tests/configs/modules/keys_to_console.yaml +++ b/tests/cloud_tests/configs/modules/keys_to_console.yaml @@ -1,6 +1,8 @@ # # Hide printing of ssh key and fingerprints for specific keys # +required_features: + - syslog cloud_config: | #cloud-config ssh_fp_console_blacklist: [ssh-dss, ssh-dsa, ecdsa-sha2-nistp256] diff --git a/tests/cloud_tests/configs/modules/landscape.yaml b/tests/cloud_tests/configs/modules/landscape.yaml index e6f4955a..ed2c37c4 100644 --- a/tests/cloud_tests/configs/modules/landscape.yaml +++ b/tests/cloud_tests/configs/modules/landscape.yaml @@ -4,6 +4,8 @@ # 2016-11-17: Disabled due to this not working # enabled: false +required_features: + - landscape cloud_config: | #cloud-conifg landscape: diff --git a/tests/cloud_tests/configs/modules/locale.yaml b/tests/cloud_tests/configs/modules/locale.yaml index af5ad636..e01518a1 100644 --- a/tests/cloud_tests/configs/modules/locale.yaml +++ b/tests/cloud_tests/configs/modules/locale.yaml @@ -1,6 +1,9 @@ # # Set locale to non-default option and verify # +required_features: + - engb_locale + - locale_gen cloud_config: | #cloud-config locale: en_GB.UTF-8 diff --git a/tests/cloud_tests/configs/modules/lxd_bridge.yaml b/tests/cloud_tests/configs/modules/lxd_bridge.yaml index 568bb700..e6b7e76a 100644 --- a/tests/cloud_tests/configs/modules/lxd_bridge.yaml +++ b/tests/cloud_tests/configs/modules/lxd_bridge.yaml @@ -1,6 +1,8 @@ # # LXD configured with directory backend and IPv4 bridge # +required_features: + - lxd cloud_config: | #cloud-config lxd: diff --git a/tests/cloud_tests/configs/modules/lxd_dir.yaml b/tests/cloud_tests/configs/modules/lxd_dir.yaml index 99b92195..f93a3fa7 100644 --- a/tests/cloud_tests/configs/modules/lxd_dir.yaml +++ b/tests/cloud_tests/configs/modules/lxd_dir.yaml @@ -1,6 +1,8 @@ # # LXD configured with directory backend # +required_features: + - lxd cloud_config: | #cloud-config lxd: diff --git a/tests/cloud_tests/configs/modules/ntp.yaml b/tests/cloud_tests/configs/modules/ntp.yaml index d0941578..0d07ef5a 100644 --- a/tests/cloud_tests/configs/modules/ntp.yaml +++ b/tests/cloud_tests/configs/modules/ntp.yaml @@ -1,6 +1,14 @@ # # Emtpy NTP config to setup using defaults # +# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' +# NOTE: this should not require no_ntpdate feature, use 'which' to check for +# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' +# NOTE: the verifier should check for any ntp server not 'ubuntu.pool.ntp.org' +required_features: + - apt + - no_ntpdate + - ubuntu_ntp cloud_config: | #cloud-config ntp: @@ -16,5 +24,8 @@ collect_scripts: ntp_conf_empty: | #!/bin/bash grep '^pool' /etc/ntp.conf + ntp_installed_list: | + #!/bin/bash + dpkg -l | grep ntp # vi: ts=4 expandtab diff --git a/tests/cloud_tests/configs/modules/ntp_pools.yaml b/tests/cloud_tests/configs/modules/ntp_pools.yaml index e040cc32..7561c7f3 100644 --- a/tests/cloud_tests/configs/modules/ntp_pools.yaml +++ b/tests/cloud_tests/configs/modules/ntp_pools.yaml @@ -1,6 +1,16 @@ # # NTP config using specific pools # +# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' +# NOTE: this should not require no_ntpdate feature, use 'which' to check for +# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' +# NOTE: lsb_release listed here because with recent cloud-init deb with +# (LP: 1628337) resolved, cloud-init will attempt to configure archives. +# this fails without lsb_release as UNAVAILABLE is used for $RELEASE +required_features: + - apt + - no_ntpdate + - lsb_release cloud_config: | #cloud-config ntp: diff --git a/tests/cloud_tests/configs/modules/ntp_servers.yaml b/tests/cloud_tests/configs/modules/ntp_servers.yaml index e0564a03..9d1d65ef 100644 --- a/tests/cloud_tests/configs/modules/ntp_servers.yaml +++ b/tests/cloud_tests/configs/modules/ntp_servers.yaml @@ -1,6 +1,13 @@ # # NTP config using specific servers # +# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' +# NOTE: this should not require no_ntpdate feature, use 'which' to check for +# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' +required_features: + - apt + - no_ntpdate + - lsb_release cloud_config: | #cloud-config ntp: diff --git a/tests/cloud_tests/configs/modules/package_update_upgrade_install.yaml b/tests/cloud_tests/configs/modules/package_update_upgrade_install.yaml index d027d540..71d24b83 100644 --- a/tests/cloud_tests/configs/modules/package_update_upgrade_install.yaml +++ b/tests/cloud_tests/configs/modules/package_update_upgrade_install.yaml @@ -1,6 +1,17 @@ # # Update/upgrade via apt and then install a pair of packages # +# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' +# NOTE: the testcase for this looks for the command in history.log as +# /usr/bin/apt-get..., which is not how it always appears. it should +# instead look for just apt-get... +# NOTE: this testcase should not require 'apt_up_out', and should look for a +# call to 'apt-get upgrade' or 'apt-get dist-upgrade' in cloud-init.log +# rather than 'Calculating upgrade...' in output +required_features: + - apt + - apt_hist_fmt + - apt_up_out cloud_config: | #cloud-config packages: diff --git a/tests/cloud_tests/configs/modules/set_hostname.yaml b/tests/cloud_tests/configs/modules/set_hostname.yaml index 5aae1506..c96344cf 100644 --- a/tests/cloud_tests/configs/modules/set_hostname.yaml +++ b/tests/cloud_tests/configs/modules/set_hostname.yaml @@ -1,6 +1,8 @@ # # Set the hostname and update /etc/hosts # +required_features: + - hostname cloud_config: | #cloud-config hostname: myhostname diff --git a/tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml b/tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml index 0014c197..daf75931 100644 --- a/tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml +++ b/tests/cloud_tests/configs/modules/set_hostname_fqdn.yaml @@ -1,6 +1,8 @@ # # Set the hostname and update /etc/hosts # +required_features: + - hostname cloud_config: | #cloud-config manage_etc_hosts: true diff --git a/tests/cloud_tests/configs/modules/set_password.yaml b/tests/cloud_tests/configs/modules/set_password.yaml index 8fa46d9f..04d7c58a 100644 --- a/tests/cloud_tests/configs/modules/set_password.yaml +++ b/tests/cloud_tests/configs/modules/set_password.yaml @@ -1,6 +1,8 @@ # # Set password of default user # +required_features: + - ubuntu_user cloud_config: | #cloud-config password: password diff --git a/tests/cloud_tests/configs/modules/set_password_expire.yaml b/tests/cloud_tests/configs/modules/set_password_expire.yaml index 926731f0..789604b0 100644 --- a/tests/cloud_tests/configs/modules/set_password_expire.yaml +++ b/tests/cloud_tests/configs/modules/set_password_expire.yaml @@ -1,6 +1,8 @@ # # Expire password for all users # +required_features: + - sshd cloud_config: | #cloud-config chpasswd: { expire: True } diff --git a/tests/cloud_tests/configs/modules/snappy.yaml b/tests/cloud_tests/configs/modules/snappy.yaml index 0e7dc852..43f93295 100644 --- a/tests/cloud_tests/configs/modules/snappy.yaml +++ b/tests/cloud_tests/configs/modules/snappy.yaml @@ -1,6 +1,8 @@ # # Install snappy # +required_features: + - snap cloud_config: | #cloud-config snappy: diff --git a/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_disable.yaml b/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_disable.yaml index 33943bdd..746653ec 100644 --- a/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_disable.yaml +++ b/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_disable.yaml @@ -1,6 +1,8 @@ # # Disable fingerprint printing # +required_features: + - syslog cloud_config: | #cloud-config ssh_genkeytypes: [] diff --git a/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_enable.yaml b/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_enable.yaml index 4c970778..9f5dc34a 100644 --- a/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_enable.yaml +++ b/tests/cloud_tests/configs/modules/ssh_auth_key_fingerprints_enable.yaml @@ -1,6 +1,11 @@ # # Print auth keys with different hash than md5 # +# NOTE: testcase checks for '256 SHA256:.*(ECDSA)' on output line on trusty +# this fails as line in output reads '256:.*(ECDSA)' +required_features: + - syslog + - ssh_key_fmt cloud_config: | #cloud-config ssh_genkeytypes: diff --git a/tests/cloud_tests/configs/modules/ssh_import_id.yaml b/tests/cloud_tests/configs/modules/ssh_import_id.yaml index 6e5a1635..b62d3f69 100644 --- a/tests/cloud_tests/configs/modules/ssh_import_id.yaml +++ b/tests/cloud_tests/configs/modules/ssh_import_id.yaml @@ -1,6 +1,9 @@ # # Import a user's ssh key via gh or lp # +required_features: + - ubuntu_user + - sudo cloud_config: | #cloud-config ssh_import_id: diff --git a/tests/cloud_tests/configs/modules/ssh_keys_generate.yaml b/tests/cloud_tests/configs/modules/ssh_keys_generate.yaml index 637d7835..659fd939 100644 --- a/tests/cloud_tests/configs/modules/ssh_keys_generate.yaml +++ b/tests/cloud_tests/configs/modules/ssh_keys_generate.yaml @@ -1,6 +1,8 @@ # # SSH keys generated using cloud-init # +required_features: + - ubuntu_user cloud_config: | #cloud-config ssh_genkeytypes: diff --git a/tests/cloud_tests/configs/modules/ssh_keys_provided.yaml b/tests/cloud_tests/configs/modules/ssh_keys_provided.yaml index 25df6452..5ceb3623 100644 --- a/tests/cloud_tests/configs/modules/ssh_keys_provided.yaml +++ b/tests/cloud_tests/configs/modules/ssh_keys_provided.yaml @@ -2,6 +2,9 @@ # SSH keys provided via cloud config # enabled: False +required_features: + - ubuntu_user + - sudo cloud_config: | #cloud-config disable_root: false diff --git a/tests/cloud_tests/configs/modules/timezone.yaml b/tests/cloud_tests/configs/modules/timezone.yaml index 8c96ed47..5112aa9f 100644 --- a/tests/cloud_tests/configs/modules/timezone.yaml +++ b/tests/cloud_tests/configs/modules/timezone.yaml @@ -1,6 +1,8 @@ # # Set system timezone # +required_features: + - daylight_time cloud_config: | #cloud-config timezone: US/Aleutian diff --git a/tests/cloud_tests/configs/modules/user_groups.yaml b/tests/cloud_tests/configs/modules/user_groups.yaml index 92655958..71cc9da3 100644 --- a/tests/cloud_tests/configs/modules/user_groups.yaml +++ b/tests/cloud_tests/configs/modules/user_groups.yaml @@ -1,6 +1,8 @@ # # Create groups and users with various options # +required_features: + - ubuntu_user cloud_config: | #cloud-config # Add groups to the system diff --git a/tests/cloud_tests/configs/modules/write_files.yaml b/tests/cloud_tests/configs/modules/write_files.yaml index 4bb2991a..ce936b7b 100644 --- a/tests/cloud_tests/configs/modules/write_files.yaml +++ b/tests/cloud_tests/configs/modules/write_files.yaml @@ -1,6 +1,10 @@ # # Write various file types # +# NOTE: on trusty 'file' has an output formatting error for binary files and +# has 2 spaces in 'LSB executable', which causes a failure here +required_features: + - no_file_fmt_e cloud_config: | #cloud-config write_files: -- cgit v1.2.3 From f0529559f9688a397f59f041dc6362e91faf96b6 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Mon, 26 Jun 2017 10:16:56 -0700 Subject: tests: update ntp tests after sntp added Recent change to ntp in artful has added the sntp package whenever ntp is installed. The tests, rather poorly, did a dpkg -l instead of checking with `which`. This fixes the ntp tests to all use `which` over expecting a certain number of lines using dpkg and as a result make the tests OS independent. --- tests/cloud_tests/configs/modules/ntp.yaml | 20 +++++--------------- tests/cloud_tests/configs/modules/ntp_pools.yaml | 8 ++------ tests/cloud_tests/configs/modules/ntp_servers.yaml | 8 ++------ tests/cloud_tests/testcases/modules/ntp.py | 11 ++++------- tests/cloud_tests/testcases/modules/ntp_pools.py | 2 +- tests/cloud_tests/testcases/modules/ntp_servers.py | 2 +- 6 files changed, 15 insertions(+), 36 deletions(-) (limited to 'tests/cloud_tests/configs/modules') diff --git a/tests/cloud_tests/configs/modules/ntp.yaml b/tests/cloud_tests/configs/modules/ntp.yaml index 0d07ef5a..fbef431b 100644 --- a/tests/cloud_tests/configs/modules/ntp.yaml +++ b/tests/cloud_tests/configs/modules/ntp.yaml @@ -1,31 +1,21 @@ # # Emtpy NTP config to setup using defaults # -# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' -# NOTE: this should not require no_ntpdate feature, use 'which' to check for -# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' -# NOTE: the verifier should check for any ntp server not 'ubuntu.pool.ntp.org' -required_features: - - apt - - no_ntpdate - - ubuntu_ntp cloud_config: | #cloud-config ntp: pools: {} servers: {} collect_scripts: - ntp_installed_empty: | + ntp_installed: | #!/bin/bash - dpkg -l | grep ntp | wc -l + ntpd --version > /dev/null 2>&1 + echo $? ntp_conf_dist_empty: | #!/bin/bash ls /etc/ntp.conf.dist | wc -l - ntp_conf_empty: | + ntp_conf_pool_list: | #!/bin/bash - grep '^pool' /etc/ntp.conf - ntp_installed_list: | - #!/bin/bash - dpkg -l | grep ntp + grep 'pool.ntp.org' /etc/ntp.conf | grep -v ^# # vi: ts=4 expandtab diff --git a/tests/cloud_tests/configs/modules/ntp_pools.yaml b/tests/cloud_tests/configs/modules/ntp_pools.yaml index 7561c7f3..3a93faa2 100644 --- a/tests/cloud_tests/configs/modules/ntp_pools.yaml +++ b/tests/cloud_tests/configs/modules/ntp_pools.yaml @@ -1,15 +1,10 @@ # # NTP config using specific pools # -# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' -# NOTE: this should not require no_ntpdate feature, use 'which' to check for -# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' # NOTE: lsb_release listed here because with recent cloud-init deb with # (LP: 1628337) resolved, cloud-init will attempt to configure archives. # this fails without lsb_release as UNAVAILABLE is used for $RELEASE required_features: - - apt - - no_ntpdate - lsb_release cloud_config: | #cloud-config @@ -21,7 +16,8 @@ cloud_config: | collect_scripts: ntp_installed_pools: | #!/bin/bash - dpkg -l | grep ntp | wc -l + ntpd --version > /dev/null 2>&1 + echo $? ntp_conf_dist_pools: | #!/bin/bash ls /etc/ntp.conf.dist | wc -l diff --git a/tests/cloud_tests/configs/modules/ntp_servers.yaml b/tests/cloud_tests/configs/modules/ntp_servers.yaml index 9d1d65ef..d59d45a8 100644 --- a/tests/cloud_tests/configs/modules/ntp_servers.yaml +++ b/tests/cloud_tests/configs/modules/ntp_servers.yaml @@ -1,12 +1,7 @@ # # NTP config using specific servers # -# NOTE: this should not require apt feature, use 'which' rather than 'dpkg -l' -# NOTE: this should not require no_ntpdate feature, use 'which' to check for -# installation rather than 'dpkg -l', as 'grep ntp' matches 'ntpdate' required_features: - - apt - - no_ntpdate - lsb_release cloud_config: | #cloud-config @@ -17,7 +12,8 @@ cloud_config: | collect_scripts: ntp_installed_servers: | #!/bin/sh - dpkg -l | grep -c ntp + ntpd --version > /dev/null 2>&1 + echo $? ntp_conf_dist_servers: | #!/bin/sh cat /etc/ntp.conf.dist | wc -l diff --git a/tests/cloud_tests/testcases/modules/ntp.py b/tests/cloud_tests/testcases/modules/ntp.py index a4b8c3d8..b50e52fe 100644 --- a/tests/cloud_tests/testcases/modules/ntp.py +++ b/tests/cloud_tests/testcases/modules/ntp.py @@ -9,8 +9,8 @@ class TestNtp(base.CloudTestCase): def test_ntp_installed(self): """Test ntp installed""" - out = self.get_data_file('ntp_installed_empty') - self.assertEqual(1, int(out)) + out = self.get_data_file('ntp_installed') + self.assertEqual(0, int(out)) def test_ntp_dist_entries(self): """Test dist config file is empty""" @@ -19,10 +19,7 @@ class TestNtp(base.CloudTestCase): def test_ntp_entires(self): """Test config entries""" - out = self.get_data_file('ntp_conf_empty') - self.assertIn('pool 0.ubuntu.pool.ntp.org iburst', out) - self.assertIn('pool 1.ubuntu.pool.ntp.org iburst', out) - self.assertIn('pool 2.ubuntu.pool.ntp.org iburst', out) - self.assertIn('pool 3.ubuntu.pool.ntp.org iburst', out) + out = self.get_data_file('ntp_conf_pool_list') + self.assertIn('pool.ntp.org iburst', out) # vi: ts=4 expandtab diff --git a/tests/cloud_tests/testcases/modules/ntp_pools.py b/tests/cloud_tests/testcases/modules/ntp_pools.py index 336076df..152fd3f1 100644 --- a/tests/cloud_tests/testcases/modules/ntp_pools.py +++ b/tests/cloud_tests/testcases/modules/ntp_pools.py @@ -10,7 +10,7 @@ class TestNtpPools(base.CloudTestCase): def test_ntp_installed(self): """Test ntp installed""" out = self.get_data_file('ntp_installed_pools') - self.assertEqual(1, int(out)) + self.assertEqual(0, int(out)) def test_ntp_dist_entries(self): """Test dist config file is empty""" diff --git a/tests/cloud_tests/testcases/modules/ntp_servers.py b/tests/cloud_tests/testcases/modules/ntp_servers.py index 4010cf80..8d2a68b3 100644 --- a/tests/cloud_tests/testcases/modules/ntp_servers.py +++ b/tests/cloud_tests/testcases/modules/ntp_servers.py @@ -10,7 +10,7 @@ class TestNtpServers(base.CloudTestCase): def test_ntp_installed(self): """Test ntp installed""" out = self.get_data_file('ntp_installed_servers') - self.assertEqual(1, int(out)) + self.assertEqual(0, int(out)) def test_ntp_dist_entries(self): """Test dist config file is empty""" -- cgit v1.2.3 From 067721672570cc83d54d2c2d5677eeb79bef85e2 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Thu, 6 Jul 2017 09:35:45 -0700 Subject: test: fix incorrect keyid for apt repository. The test is currently importing the incorrect keyid. It specifies the curtin developers ppa, rather than the cloud-init ppa. On Artful this causes failures as a check is made to verify the correct key is imported for the ppa, whereas on previous releases only a warning was issued. Also, change to use a full key fingerprint. LP: #1702717 --- .../cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml | 2 +- .../cloud_tests/testcases/modules/apt_configure_sources_keyserver.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/cloud_tests/configs/modules') diff --git a/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml b/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml index 11da61ea..25088135 100644 --- a/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml +++ b/tests/cloud_tests/configs/modules/apt_configure_sources_keyserver.yaml @@ -9,7 +9,7 @@ cloud_config: | apt: sources: source1: - keyid: 0165013E + keyid: 1FF0D8535EF7E719E5C81B9C083D06FBE4D304DF keyserver: keyserver.ubuntu.com source: "deb http://ppa.launchpad.net/cloud-init-dev/test-archive/ubuntu $RELEASE main" collect_scripts: diff --git a/tests/cloud_tests/testcases/modules/apt_configure_sources_keyserver.py b/tests/cloud_tests/testcases/modules/apt_configure_sources_keyserver.py index 2e6b293f..ddc86174 100644 --- a/tests/cloud_tests/testcases/modules/apt_configure_sources_keyserver.py +++ b/tests/cloud_tests/testcases/modules/apt_configure_sources_keyserver.py @@ -11,8 +11,8 @@ class TestAptconfigureSourcesKeyserver(base.CloudTestCase): """Test specific key added.""" out = self.get_data_file('apt_key_list') self.assertIn( - '1BC3 0F71 5A3B 8612 47A8 1A5E 55FE 7C8C 0165 013E', out) - self.assertIn('Launchpad PPA for curtin developers', out) + '1FF0 D853 5EF7 E719 E5C8 1B9C 083D 06FB E4D3 04DF', out) + self.assertIn('Launchpad PPA for cloud init development team', out) def test_source_list(self): """Test source.list updated.""" -- cgit v1.2.3