From fb69b034792705aed8045ea352c08420fad02f6a Mon Sep 17 00:00:00 2001 From: Maksym Strukov Date: Fri, 7 Aug 2015 16:42:38 +0300 Subject: [PATCH] Remove puppet modules tests Remove puppet env due it is not used Change-Id: I3bf402c47d0c0b0c56465d9573a93f074125f403 Related-Bug: #1482642 --- doc/index.rst | 1 - doc/puppet_tests.rst | 19 --- fuelweb_test/make_pptests.py | 21 --- fuelweb_test/models/pp_environment.py | 55 -------- fuelweb_test/puppet_tests/__init__.py | 1 - fuelweb_test/puppet_tests/pp_testgenerator.py | 132 ------------------ fuelweb_test/puppet_tests/puppet_module.py | 122 ---------------- fuelweb_test/puppet_tests/puppet_test.py | 81 ----------- .../puppet_tests/templates/debug_template.txt | 22 --- .../templates/puppet_module_test.py.tmpl | 53 ------- .../test_data/acpid/manifests/init.pp | 42 ------ .../test_data/acpid/tests/acpid_off.pp | 4 - .../test_data/acpid/tests/acpid_off.sh | 9 -- .../test_data/acpid/tests/acpid_on.pp | 4 - .../test_data/acpid/tests/acpid_on.sh | 5 - .../puppet_tests/test_data/motd/.rspec | 2 - .../puppet_tests/test_data/motd/Rakefile | 9 -- .../test_data/motd/manifests/init.pp | 13 -- .../test_data/motd/spec/classes/motd_spec.rb | 17 --- .../motd/spec/fixtures/manifests/site.pp | 0 .../motd/spec/fixtures/modules/motd/manifests | 1 - .../test_data/motd/spec/spec_helper.rb | 8 -- .../puppet_tests/test_data/motd/tests/motd.pp | 2 - .../test_data/ntp/files/centos-ntp.conf | 57 -------- .../test_data/ntp/files/ubuntu-ntp.conf | 55 -------- .../test_data/ntp/manifests/init.pp | 43 ------ .../puppet_tests/test_data/ntp/tests/ntp.pp | 2 - fuelweb_test/puppet_tests/tests/.gitignore | 1 - 28 files changed, 781 deletions(-) delete mode 100644 doc/puppet_tests.rst delete mode 100644 fuelweb_test/make_pptests.py delete mode 100644 fuelweb_test/models/pp_environment.py delete mode 100644 fuelweb_test/puppet_tests/__init__.py delete mode 100755 fuelweb_test/puppet_tests/pp_testgenerator.py delete mode 100644 fuelweb_test/puppet_tests/puppet_module.py delete mode 100644 fuelweb_test/puppet_tests/puppet_test.py delete mode 100644 fuelweb_test/puppet_tests/templates/debug_template.txt delete mode 100644 fuelweb_test/puppet_tests/templates/puppet_module_test.py.tmpl delete mode 100644 fuelweb_test/puppet_tests/test_data/acpid/manifests/init.pp delete mode 100644 fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.pp delete mode 100755 fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.sh delete mode 100644 fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.pp delete mode 100755 fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.sh delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/.rspec delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/Rakefile delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/manifests/init.pp delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/spec/classes/motd_spec.rb delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/manifests/site.pp delete mode 120000 fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/modules/motd/manifests delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/spec/spec_helper.rb delete mode 100644 fuelweb_test/puppet_tests/test_data/motd/tests/motd.pp delete mode 100644 fuelweb_test/puppet_tests/test_data/ntp/files/centos-ntp.conf delete mode 100644 fuelweb_test/puppet_tests/test_data/ntp/files/ubuntu-ntp.conf delete mode 100644 fuelweb_test/puppet_tests/test_data/ntp/manifests/init.pp delete mode 100644 fuelweb_test/puppet_tests/test_data/ntp/tests/ntp.pp delete mode 100644 fuelweb_test/puppet_tests/tests/.gitignore diff --git a/doc/index.rst b/doc/index.rst index 9c606e115..e3bb172af 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,6 +8,5 @@ Documentation for the QA test code repo models.rst helpers.rst base_tests.rst - puppet_tests.rst testrail.rst diff --git a/doc/puppet_tests.rst b/doc/puppet_tests.rst deleted file mode 100644 index 23bd17442..000000000 --- a/doc/puppet_tests.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. index:: Puppet tests - -Puppet tests -============ - -Puppet test generator ---------------------- -.. automodule:: fuelweb_test.puppet_tests.pp_testgenerator - :members: - -Puppet module -------------- -.. automodule:: fuelweb_test.puppet_tests.puppet_module - :members: - -Puppet test ------------ -.. automodule:: fuelweb_test.puppet_tests.puppet_test - :members: diff --git a/fuelweb_test/make_pptests.py b/fuelweb_test/make_pptests.py deleted file mode 100644 index 26cb6f4f6..000000000 --- a/fuelweb_test/make_pptests.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Script for creating Puppet integration tests scripts using template engine. -""" - -import argparse -from puppet_tests.pp_testgenerator import PuppetTestGenerator - -parser = argparse.ArgumentParser() -parser.add_argument("tests", type=str, help="Directory to save tests") -parser.add_argument("modules", type=str, help="Path to Puppet modules") -parser.add_argument("-k", "--keep_tests", - action='store_true', - help="Keep previous test files", - default=False) - -args = parser.parse_args() -generator = PuppetTestGenerator(args.tests, args.modules) -if not args.keep_tests: - generator.remove_all_tests() - -generator.make_all_scripts() diff --git a/fuelweb_test/models/pp_environment.py b/fuelweb_test/models/pp_environment.py deleted file mode 100644 index ce27ca30a..000000000 --- a/fuelweb_test/models/pp_environment.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import os - -from devops.helpers.helpers import tcp_ping -from devops.helpers.helpers import wait -from fuelweb_test.models.environment import EnvironmentModel -from fuelweb_test import settings - - -class PuppetEnvironment(EnvironmentModel): - """Create environment for puppet modules testing.""" - - def __init__(self, os_image=None): - """Constructor for create environment.""" - self.os_image = os_image or settings.OS_IMAGE - super(PuppetEnvironment, self).__init__(self.os_image) - self.environment = super(PuppetEnvironment, self).d_env - self.start_env() - - @property - def env_name(self): - return os.environ.get('PPENV_NAME', 'pp-integration') - - def start_env(self): - self.d_env.start(self.d_env.nodes()) - - def execute_cmd(self, command, debug=True): - """Execute command on node.""" - return self.d_env.get_admin_remote().execute( - command, verbose=debug)['exit_code'] - - def await(self, timeout=1200): - wait( - lambda: tcp_ping(self.get_admin_node_ip(), 22), timeout=timeout) - - -if __name__ == "__main__": - env = PuppetEnvironment( - '/var/lib/libvirt/images/ubuntu-12.04.1-server-amd64-p2.qcow2') - env.await() - env.make_snapshot(snapshot_name="test1") - env.execute_cmd('apt-get install mc') diff --git a/fuelweb_test/puppet_tests/__init__.py b/fuelweb_test/puppet_tests/__init__.py deleted file mode 100644 index 679821db3..000000000 --- a/fuelweb_test/puppet_tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'aurlapova' diff --git a/fuelweb_test/puppet_tests/pp_testgenerator.py b/fuelweb_test/puppet_tests/pp_testgenerator.py deleted file mode 100755 index a7397d94c..000000000 --- a/fuelweb_test/puppet_tests/pp_testgenerator.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging -import os - -import jinja2 - -from puppet_module import PuppetModule - - -class PuppetTestGenerator: - """Puppet Test Generator - This is main class. It finds all modules in the given directory and creates - tests for them. - You should give constructor following arguments: - - - local_modules_path* Path to puppet modules which will be scanned for - test files - - tests_directory_path* Output directory where files will be written - - debug level - """ - - def __init__(self, tests_directory_path, modules_path): - """Constructor - Constructor - """ - if not os.path.isdir(modules_path): - logging.error('No such directory: ' + modules_path) - - if not os.path.isdir(tests_directory_path): - logging.error('No such directory: ' + tests_directory_path) - - self.modules_path = modules_path - self.tests_directory = tests_directory_path - - self.default_template = 'puppet_module_test.py.tmpl' - self.test_file_prefix = 'TestPuppetModule' - - self.modules = [] - self.module_templates = {} - self.make_tests_dir = os.path.dirname(os.path.abspath(__file__)) - - if not os.path.isdir('puppet_tests/templates'): - logging.error("No such directory: puppet_tests/templates") - self.template_directory = 'puppet_tests/templates' - self.template_loader = jinja2.FileSystemLoader( - searchpath='puppet_tests/templates') - self.template_environment = jinja2.Environment( - loader=self.template_loader, - ) - - self.internal_modules_path = '/etc/puppet/modules' - self.internal_manifests_path = '/etc/puppet/manifests' - - self.find_modules() - - def find_modules(self): - """Find modules in library path - Find all Puppet modules in module_library_path - and create array of PuppetModule objects - """ - logging.debug('Starting find modules in "%s"' % self.modules_path) - for module_dir in os.listdir(self.modules_path): - full_module_path = os.path.join(self.modules_path, module_dir) - full_tests_path = os.path.join(full_module_path, 'tests') - if not os.path.isdir(full_tests_path): - continue - logging.debug('Found Puppet module: "%s"' % full_module_path) - puppet_module = PuppetModule(full_module_path) - self.modules.append(puppet_module) - - def compile_script(self, module): - """Compile script template - Compile script template for given module and return it - """ - template_file = self.module_templates.get(module.name, - self.default_template) - template = self.template_environment.get_template(template_file) - general = { - 'local_modules_path': self.modules_path, - 'internal_modules_path': self.internal_modules_path, - 'internal_manifests_path': self.internal_manifests_path, - 'tests_directory_path': self.tests_directory - } - compiled_template = template.render(module=module, **general) - return compiled_template - - def save_script(self, module): - """Save compiled script - Saves compiled script to a file - """ - file_name = self.test_file_prefix + module.name.title() + '.py' - full_file_path = os.path.join(self.tests_directory, file_name) - script_content = self.compile_script(module) - script_file = open(full_file_path, 'w+') - script_file.write(script_content) - script_file.close() - - def make_all_scripts(self): - """Compile and save all scripts - Compile and save to tests_directory_path all the test scripts. - Main function. - """ - for module in self.modules: - logging.debug('Processing module: "%s"' % module.name) - self.save_script(module) - - def remove_all_tests(self): - """Remove all tests - Remove all tests from tests_directory_path - """ - file_list = os.listdir(self.tests_directory) - for test_file in file_list: - if not test_file.endswith('.py'): - continue - if not test_file.startswith('TestPuppetModule'): - continue - full_file_path = os.path.join(self.tests_directory, test_file) - logging.debug('Removing test file: "%s"' % full_file_path) - os.remove(full_file_path) diff --git a/fuelweb_test/puppet_tests/puppet_module.py b/fuelweb_test/puppet_tests/puppet_module.py deleted file mode 100644 index 3d652588a..000000000 --- a/fuelweb_test/puppet_tests/puppet_module.py +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging -import os -import re -import sys - -from puppet_test import PuppetTest - -path = os.path.abspath(__file__) -path = os.path.dirname(path) -sys.path.insert(0, path) - - -class PuppetModule: - """This class represents Puppet module.""" - - def __init__(self, local_module_path): - """You should give this constructor the full path to the module.""" - self.local_module_path = local_module_path - self.module_name = os.path.basename(self.local_module_path) - - self.__tests = [] - self.__dependencies = [] - - self.comment_regexp = re.compile(r'^\s*#') - self.dependency_regexp = \ - re.compile(r'^\s*dependency\s*[\'\"]*([^\'\"]+)[\'\"]*') - - self.find_tests() - self.find_dependencies() - - def find_dependencies(self): - """Get dependencies of this module from Modulefile if present.""" - module_file = 'Modulefile' - dependencies = [] - module_file_path = os.path.join(self.local_module_path, module_file) - if not os.path.isfile(module_file_path): - self.__dependencies = dependencies - return False - opened_file = open(module_file_path, 'r') - for line in opened_file.readlines(): - if re.match(self.comment_regexp, line): - # skip commented line - continue - match = re.match(self.dependency_regexp, line) - if match: - # found dependency line - dependency_name = match.group(1).split('/')[-1] - dependencies.append(dependency_name) - self.__dependencies = dependencies - return True - - def find_tests(self): - """Find all tests. - Find all tests in this module and fill tests array - with PuppetTest objects. - """ - current_path = os.path.abspath(os.curdir) - try: - os.chdir(self.local_module_path) - except OSError as error: - logging.error("Cannot change directory to %s: %s" % - (self.local_module_path, error.message)) - else: - for root, dirs, files in os.walk('tests'): - for test_file in files: - if not test_file[-3:] == '.pp': - continue - test_file_path = os.path.join(root, test_file) - puppet_test = PuppetTest(test_file_path) - self.__tests.append(puppet_test) - finally: - # try to restore original folder on exit - try: - os.chdir(current_path) - except OSError as error: - logging.error("Cannot change directory to %s: %s" % - (self.local_module_path, error.message), 1) - - @property - def tests(self): - """Property returns list of tests.""" - return self.__tests - - @property - def name(self): - """Property returns module name.""" - return self.module_name - - @property - def path(self): - """Property returns path to this module.""" - return self.local_module_path - - @property - def dependencies(self): - """Property returns list of module dependencies.""" - return self.__dependencies - - def __repr__(self): - """String representation of PuppetModule.""" - tests_string = '' - if len(self.tests) > 0: - tests = [repr(test) for test in self.tests] - tests_string += ", ".join(tests) - tpl = "PuppetModule(name=%s, path=%s, tests=[%s]" \ - % (self.name, self.path, tests_string) - - return tpl diff --git a/fuelweb_test/puppet_tests/puppet_test.py b/fuelweb_test/puppet_tests/puppet_test.py deleted file mode 100644 index 3b59ba543..000000000 --- a/fuelweb_test/puppet_tests/puppet_test.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from glob import glob -import os -import stat - - -class PuppetTest: - """This class represents single test of the Puppet module.""" - - def __init__(self, test_file_path): - """You should give this constructor path to test file.""" - self.test_file_path = test_file_path - self.tests_path = os.path.dirname(self.test_file_path) - self.test_file_name = os.path.basename(self.test_file_path) - self.test_name = self.test_file_name.replace('.pp', '') - self.find_verify_file() - - def find_verify_file(self): - """Get verify script for this test if there is one.""" - pattern = os.path.join(self.tests_path, self.test_name) + '*' - verify_files = glob(pattern) - verify_files = [os.path.basename(verify_file) - for verify_file in verify_files - if not verify_file.endswith('.pp')] - if verify_files: - self.__verify_file = verify_files[0] - self.make_verify_executable() - else: - self.__verify_file = None - - def make_verify_executable(self): - """Set executable bit for a file.""" - file_path = os.path.join(self.tests_path, self.__verify_file) - if not os.path.isfile(file_path): - return False - file_stat = os.stat(file_path) - os.chmod( - file_path, - file_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) - return True - - @property - def path(self): - """Return path to test. - Property returns path to this test relative to module and excluding - file name - """ - return self.tests_path - - @property - def file(self): - """Property returns this tests' file name.""" - return self.test_file_name - - @property - def name(self): - """Property returns name of this test.""" - return self.test_name - - @property - def verify_file(self): - """Property returns verify file name.""" - return self.__verify_file - - def __repr__(self): - """String representation of PuppetTest.""" - return "PuppetTest(name=%s, path=%s, file=%s)" % \ - (self.name, self.path, self.file) diff --git a/fuelweb_test/puppet_tests/templates/debug_template.txt b/fuelweb_test/puppet_tests/templates/debug_template.txt deleted file mode 100644 index 7b9300278..000000000 --- a/fuelweb_test/puppet_tests/templates/debug_template.txt +++ /dev/null @@ -1,22 +0,0 @@ -# modules_path="{{ modules_path }}" -# local_modules_path="{{ local_modules_path }}" -# internal_modules_path="{{ internal_modules_path }}" -# internal_manifests_path="{{ internal_manifests_path }}" -# tests_directory_path="{{ tests_directory_path }}" - -# Module - -# module.name="{{ module.name }}" -# module.path="{{ module.path }}" -# module.tests="{{ module.tests }}" -# module.dependencies="{{ module.dependencies }}" - -# Module "{{ module.name }}" has {{ module.tests|count }} tests: -{% set count = 0 -%} -{% for test in module.tests -%} -{% set count = count + 1 -%} -# Test {{ count }}: -# test.name="{{ test.name }}" -# test.path="{{ test.path }}" -# test.file="{{ test.file }}" -{% endfor -%} \ No newline at end of file diff --git a/fuelweb_test/puppet_tests/templates/puppet_module_test.py.tmpl b/fuelweb_test/puppet_tests/templates/puppet_module_test.py.tmpl deleted file mode 100644 index 0d4f93ac9..000000000 --- a/fuelweb_test/puppet_tests/templates/puppet_module_test.py.tmpl +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from fuelweb_test.helpers.decorators import debug -from fuelweb_test.helpers.decorators import upload_manifests -from fuelweb_test.models.pp_environment import PuppetEnvironment - -import logging -import unittest - -logger = logging.getLogger('integration') -logwrap = debug(logger) - - -class TestPuppetModule{{ module.name|title }}(unittest.TestCase): # flake8: noqa - @upload_manifests - def setUp(self): - self.env = PuppetEnvironment() - self.env.await() - self.puppet_apply = "puppet apply " \ - "--verbose " \ - "--detailed-exitcodes " \ - "--modulepath='{{ internal_modules_path }}'" - - if not self.env.d_env.has_snapshot("before_test"): - self.env.make_snapshot(snapshot_name="before_test") -{% for test in module.tests %} # flake8: noqa - def test_{{ test.name|title }}(self): # flake8: noqa - manifest = \ - "{{ internal_modules_path }}/{{ module.name }}/{{ test.path }}/{{test.file }}" # flake8: noqa - result = self.env.execute_cmd("%s '%s'" % (self.puppet_apply,manifest)) # flake8: noqa - self.assertIn(result, [0, 2]) -{% endfor %} # flake8: noqa - def tearDown(self): # flake8: noqa - self.env.revert_snapshot("before_test") - -if __name__ == '__main__': - unittest.main() - -{# Enable this to get a debug list with all template values -{% include 'debug_template.txt' %} -#} diff --git a/fuelweb_test/puppet_tests/test_data/acpid/manifests/init.pp b/fuelweb_test/puppet_tests/test_data/acpid/manifests/init.pp deleted file mode 100644 index 754e83ba9..000000000 --- a/fuelweb_test/puppet_tests/test_data/acpid/manifests/init.pp +++ /dev/null @@ -1,42 +0,0 @@ -# Class: acpid -# -# Sample for usage acpid -# -# -class acpid($status = true) { - - if ($::osfamily == 'Debian') { - $package = 'acpid' - $service = 'acpid' - } - elsif ($::osfamily == 'RedHat') { - $package = 'acpid' - $service = 'acpid' - } - else { - fail("Module ${module_name} is not supported on ${::operatingsystem}!") - } - - if ($status) { - $ensure = 'running' - $enable = true - } - else { - $ensure = 'stopped' - $enable = false - } - - package { $package : - ensure => installed, - } - - service { $service : - ensure => $ensure, - enable => $enable, - hasrestart => true, - hasstatus => true, - } - - Package[$package] -> Service[$service] - -} diff --git a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.pp b/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.pp deleted file mode 100644 index 733155f16..000000000 --- a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.pp +++ /dev/null @@ -1,4 +0,0 @@ -# acpid_off -class { 'acpid' : - status => false, -} diff --git a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.sh b/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.sh deleted file mode 100755 index d1ca66663..000000000 --- a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_off.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' - -ps axuwww | grep -v grep | grep -q " acpid " -if [ $? -gt 0 ]; then - return 0 -else - return 1 -fi diff --git a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.pp b/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.pp deleted file mode 100644 index 490ff104d..000000000 --- a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.pp +++ /dev/null @@ -1,4 +0,0 @@ -# acpid_on -class { 'acpid' : - status => true, -} diff --git a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.sh b/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.sh deleted file mode 100755 index 8e0668ed3..000000000 --- a/fuelweb_test/puppet_tests/test_data/acpid/tests/acpid_on.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' - -ps axuwww | grep -v grep | grep -q " acpid " -return $? diff --git a/fuelweb_test/puppet_tests/test_data/motd/.rspec b/fuelweb_test/puppet_tests/test_data/motd/.rspec deleted file mode 100644 index 7438fbe51..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---colour ---format documentation diff --git a/fuelweb_test/puppet_tests/test_data/motd/Rakefile b/fuelweb_test/puppet_tests/test_data/motd/Rakefile deleted file mode 100644 index b7ebf5926..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/Rakefile +++ /dev/null @@ -1,9 +0,0 @@ -require 'rake' - -require 'rspec/core/rake_task' - -task :default => :spec - -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = 'spec/*/*_spec.rb' -end diff --git a/fuelweb_test/puppet_tests/test_data/motd/manifests/init.pp b/fuelweb_test/puppet_tests/test_data/motd/manifests/init.pp deleted file mode 100644 index c46c47b68..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/manifests/init.pp +++ /dev/null @@ -1,13 +0,0 @@ -# = Class: motd -# -# Create file /etc/motd. -# -class motd { - file { '/etc/motd' : - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => 'Hello!', - } -} diff --git a/fuelweb_test/puppet_tests/test_data/motd/spec/classes/motd_spec.rb b/fuelweb_test/puppet_tests/test_data/motd/spec/classes/motd_spec.rb deleted file mode 100644 index 044ad385a..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/spec/classes/motd_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe 'motd' do - it do - should contain_file('/etc/motd').with({ - 'ensure' => 'present', - 'owner' => 'root', - 'group' => 'root', - 'mode' => '0644', - }) - end - - it do - should contain_file('/etc/motd').with_content('Hello!') - end - -end diff --git a/fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/manifests/site.pp b/fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/manifests/site.pp deleted file mode 100644 index e69de29bb..000000000 diff --git a/fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/modules/motd/manifests b/fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/modules/motd/manifests deleted file mode 120000 index 373b99206..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/spec/fixtures/modules/motd/manifests +++ /dev/null @@ -1 +0,0 @@ -../../../../manifests \ No newline at end of file diff --git a/fuelweb_test/puppet_tests/test_data/motd/spec/spec_helper.rb b/fuelweb_test/puppet_tests/test_data/motd/spec/spec_helper.rb deleted file mode 100644 index d3923f830..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/spec/spec_helper.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'rspec-puppet' - -fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) - -RSpec.configure do |c| - c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') -end diff --git a/fuelweb_test/puppet_tests/test_data/motd/tests/motd.pp b/fuelweb_test/puppet_tests/test_data/motd/tests/motd.pp deleted file mode 100644 index 8af26bf8c..000000000 --- a/fuelweb_test/puppet_tests/test_data/motd/tests/motd.pp +++ /dev/null @@ -1,2 +0,0 @@ -# motd test -include motd diff --git a/fuelweb_test/puppet_tests/test_data/ntp/files/centos-ntp.conf b/fuelweb_test/puppet_tests/test_data/ntp/files/centos-ntp.conf deleted file mode 100644 index 78e2d5b84..000000000 --- a/fuelweb_test/puppet_tests/test_data/ntp/files/centos-ntp.conf +++ /dev/null @@ -1,57 +0,0 @@ -# For more information about this file, see the man pages -# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5). - -driftfile /var/lib/ntp/drift - -# Permit time synchronization with our time source, but do not -# permit the source to query or modify the service on this system. -restrict default kod nomodify notrap nopeer noquery -restrict -6 default kod nomodify notrap nopeer noquery - -# Permit all access over the loopback interface. This could -# be tightened as well, but to do so would effect some of -# the administrative functions. -restrict 127.0.0.1 -restrict -6 ::1 - -# Hosts on local network are less restricted. -#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap - -# Use public servers from the pool.ntp.org project. -# Please consider joining the pool (http://www.pool.ntp.org/join.html). -server 0.centos.pool.ntp.org -server 1.centos.pool.ntp.org -server 2.centos.pool.ntp.org - -#broadcast 192.168.1.255 autokey # broadcast server -#broadcastclient # broadcast client -#broadcast 224.0.1.1 autokey # multicast server -#multicastclient 224.0.1.1 # multicast client -#manycastserver 239.255.254.254 # manycast server -#manycastclient 239.255.254.254 autokey # manycast client - -# Undisciplined Local Clock. This is a fake driver intended for backup -# and when no outside source of synchronized time is available. -#server 127.127.1.0 # local clock -#fudge 127.127.1.0 stratum 10 - -# Enable public key cryptography. -#crypto - -includefile /etc/ntp/crypto/pw - -# Key file containing the keys and key identifiers used when operating -# with symmetric key cryptography. -keys /etc/ntp/keys - -# Specify the key identifiers which are trusted. -#trustedkey 4 8 42 - -# Specify the key identifier to use with the ntpdc utility. -#requestkey 8 - -# Specify the key identifier to use with the ntpq utility. -#controlkey 8 - -# Enable writing of statistics records. -#statistics clockstats cryptostats loopstats peerstats diff --git a/fuelweb_test/puppet_tests/test_data/ntp/files/ubuntu-ntp.conf b/fuelweb_test/puppet_tests/test_data/ntp/files/ubuntu-ntp.conf deleted file mode 100644 index 445765215..000000000 --- a/fuelweb_test/puppet_tests/test_data/ntp/files/ubuntu-ntp.conf +++ /dev/null @@ -1,55 +0,0 @@ -# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help - -driftfile /var/lib/ntp/ntp.drift - - -# Enable this if you want statistics to be logged. -#statsdir /var/log/ntpstats/ - -statistics loopstats peerstats clockstats -filegen loopstats file loopstats type day enable -filegen peerstats file peerstats type day enable -filegen clockstats file clockstats type day enable - -# Specify one or more NTP servers. - -# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board -# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for -# more information. -server 0.ubuntu.pool.ntp.org -server 1.ubuntu.pool.ntp.org -server 2.ubuntu.pool.ntp.org -server 3.ubuntu.pool.ntp.org - -# Use Ubuntu's ntp server as a fallback. -server ntp.ubuntu.com - -# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for -# details. The web page -# might also be helpful. -# -# Note that "restrict" applies to both servers and clients, so a configuration -# that might be intended to block requests from certain clients could also end -# up blocking replies from your own upstream servers. - -# By default, exchange time with everybody, but don't allow configuration. -restrict -4 default kod notrap nomodify nopeer noquery -restrict -6 default kod notrap nomodify nopeer noquery - -# Local users may interrogate the ntp server more closely. -restrict 127.0.0.1 -restrict ::1 - -# Clients from this (example!) subnet have unlimited access, but only if -# cryptographically authenticated. -#restrict 192.168.123.0 mask 255.255.255.0 notrust - - -# If you want to provide time to your local subnet, change the next line. -# (Again, the address is an example only.) -#broadcast 192.168.123.255 - -# If you want to listen to time broadcasts on your local subnet, de-comment the -# next lines. Please do this only if you trust everybody on the network! -#disable auth -#broadcastclient diff --git a/fuelweb_test/puppet_tests/test_data/ntp/manifests/init.pp b/fuelweb_test/puppet_tests/test_data/ntp/manifests/init.pp deleted file mode 100644 index 719e47fe6..000000000 --- a/fuelweb_test/puppet_tests/test_data/ntp/manifests/init.pp +++ /dev/null @@ -1,43 +0,0 @@ -# = Class: ntp -# -# Sample of usage ntp, -# create config and start service ntp. -# -class ntp { - if $::osfamily == 'RedHat' { - $package = 'ntp' - $service = 'ntpd' - $config = '/etc/ntp.conf' - $conf_from = 'centos-ntp.conf' - } elsif $::osfamily == 'Debian' { - $package = 'ntp' - $service = 'ntp' - $config = '/etc/ntp.conf' - $conf_from = 'ubuntu-ntp.conf' - } - else { - fail("Module ${module_name} is not supported on ${::operatingsystem}!") - } - - package { $package : - ensure => installed, - } - - file { $config : - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - source => "puppet:///modules/ntp/${conf_from}", - } - - service { $service : - ensure => 'running', - enable => true, - hasrestart => true, - hasstatus => true, - } - - Package[$package] -> File[$config] ~> Service[$service] - -} diff --git a/fuelweb_test/puppet_tests/test_data/ntp/tests/ntp.pp b/fuelweb_test/puppet_tests/test_data/ntp/tests/ntp.pp deleted file mode 100644 index ea06f9593..000000000 --- a/fuelweb_test/puppet_tests/test_data/ntp/tests/ntp.pp +++ /dev/null @@ -1,2 +0,0 @@ -# ntp class test -include ntp diff --git a/fuelweb_test/puppet_tests/tests/.gitignore b/fuelweb_test/puppet_tests/tests/.gitignore deleted file mode 100644 index f104652b6..000000000 --- a/fuelweb_test/puppet_tests/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.py