예제 #1
0
def check():
    env.platform_family = detect.detect()
    # file
    assert file.exists("/etc/hosts")
    assert file.is_file("/etc/hosts")
    assert file.is_dir("/tmp/")
    assert file.dir_exists("/tmp/")
    assert file.has_line("/etc/passwd", "sshd")
    assert file.owner_is("/bin/sh", "root")
    if env.platform_family == "freebsd":
        assert file.is_link("/compat")
        assert file.group_is("/bin/sh", "wheel")
        assert file.mode_is("/bin/sh", "555")
    else:
        assert file.is_link("/usr/tmp")
        assert file.group_is("/bin/sh", "root")
        assert file.mode_is("/bin/sh", "777")

    assert package.installed("wget.x86_64")

    assert user.exists("sshd")
    assert user.is_belonging_group("worker", "users")

    assert group.is_exists("wheel")

    assert port.is_listening(22)
    assert cron.has_entry('shirou', 'python')

    if env.platform_family == "freebsd":
        assert service.is_enabled("apache22")
        assert process.is_up("httpd")
    else:
        assert service.is_enabled("http")
        assert process.is_up("http") is False
예제 #2
0
def check():
    env.platform_family = detect.detect()

    config_js = '/var/app/current/config.js'
    assert file.exists(config_js), \
        "%s does not exist" % config_js
    assert file_contains(config_js, 'StrictHostKeyChecking false'), \
        "%s does not turn off StrictHostKeyChecking" % config_js

    dot_npm = "/home/my_nodejs_app/.npm"
    assert file.exists(dot_npm), \
        "%s does not exist" % dot_npm
    assert file.is_dir(dot_npm), \
        "%s is not a directory" % dot_npm
    assert file.is_mode(dot_npm, 'r-xr-xr-x'), \
        "%s is not mode 755" % dot_npm
    assert file.owner_is(dot_npm, 'my_nodejs_app'), \
        "%s is not owned by my_nodejs_app" % dot_npm
    # directory { should be_grouped_into 'my_nodejs_app' }

    assert port.is_listening(80), "port 80/apache2 is not listening"

    assert user.exists("my_nodejs_app"), "user my_nodejs_app does not exist"
    assert user_has_shell('my_nodejs_app', ':/bin/bash'), \
        "user should have bash shell"

    assert process.is_up("node"), "node process is not up"
    # its('args') { should match 'server.js|app.js' }

    assert service.is_enabled("my_nodejs_app"), \
        "my_nodejs_app service is not enabled"

    assert apache2_is_responding(), "node demo app did not respond as expected"
예제 #3
0
def check():
    env.platform_family = detect.detect()

    # web server is listening
    assert port.is_listening(80), 'Web port 80 is not listening'

    # redis is listening
    assert port.is_listening(6379), 'Redis port 6379 is not listening'
    assert port.is_listening(6380), 'Redis port 6380 is not listening'
    assert port.is_listening(6381), 'Redis port 6381 is not listening'

    # nginx user is created
    assert user.exists("nginx"), 'nginx user does not exist'
    
    if (env.platform_family == "rhel"):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php-fpm'), 'php-fpm is not enabled'
    elif (env.platform_family == 'debian'):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php5-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php5-fpm'), 'php-fpm is not enabled'

    # magento main page is available
    assert magento_is_responding(), 'Magento did not respond as expected.'
예제 #4
0
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(25565), 'port 25535/minecraft is not listening'

    assert service.is_enabled(
        'minecraft-server'), 'Minecraft Server is not enabled'
예제 #5
0
def check():
    env.platform_family = detect.detect()

    packages = ['st2common',
                'st2reactor',
                'st2actions',
                'st2api',
                'st2auth',
                'st2debug',
                'python-st2client',
                'rabbitmq-server',
                'mongodb-server',
                'mysql-server'
                ]

    services = ['actionrunner',
                'st2api',
                'sensor_container',
                'rules_engine',
                'mistral',
                'st2resultstracker',
                'rabbitmq-server',
                'mongodb',
                'mysql'
                ]

    for pkg in packages:
        assert package.installed(pkg),\
            "package {0} is not installed".format(pkg)

    for srv in services:
        assert service.is_enabled(srv),\
            "service {0} is not enabled".format(srv)

    assert user.exists("stanley"), "user stanley does not exist"
예제 #6
0
def check():
    env.platform_family = detect.detect()

    dot_npm = "/home/user1/.npm"
    assert file.exists(dot_npm), \
        "%s does not exist" % dot_npm
    assert file.is_dir(dot_npm), \
        "%s is not a directory" % dot_npm
    assert file.mode_is(dot_npm, '755'), \
        "%s is not mode 755" % dot_npm
    assert file.owner_is(dot_npm, 'user1'), \
        "%s is not owned by user1" % dot_npm
    # directory { should be_grouped_into 'my_nodejs_app' }

    assert port.is_listening(80), "port 80/apache2 is not listening"

    assert user.exists("user1"), "user my_nodejs_app does not exist"

    assert process.is_up("node"), "node process is not up"
    # its('args') { should match 'server.js|app.js' }

    assert service.is_enabled("node-app"), \
        "node-app service is not enabled"

    assert nodejs_is_responding(), "node demo app did not respond as expected"
예제 #7
0
def check():
    env.platform_family = detect.detect()

    assert file.is_dir("/var/www/vhosts"), '/var/www/vhosts is wrong'
    assert port.is_listening(80), 'port 80 not listening'
    assert port.is_listening(8080), 'port 8080 not listening'
    assert package.installed("varnish"), 'varnish not installed'
    assert drupal_is_responding(), 'Drupal did not respond as expected.'

    apache_process = 'apache2'
    php_package = 'php5'

    if env.platform_family == 'debian':
        apache_process = 'apache2'
        php_package = 'php5'
    elif env.platform_family == 'rhel':
        apache_process = 'httpd'
        php_package = 'php'
    else:
        raise ValueError('OS ' + env.platform_family +
                         ' unknown, update tests.')

    assert package.installed(php_package), 'php not installed'
    assert process.is_up(apache_process), 'apache is not running'
    assert service.is_enabled(apache_process), 'apache is not enabled'
예제 #8
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/var/www/vhosts/example.com/xmlrpc.php'),\
        'xmlrpc.php did not exist'

    assert port.is_listening(21), 'port 21/vsftpd is not listening'
    assert port.is_listening(80), 'port 80/varnishd is not listening'
    assert port.is_listening(3306), 'port 3306/mysqld is not listening'
    assert port.is_listening(6082), 'port 6082/varnishd is not listening'
    assert port.is_listening(8080), 'port 8080/apache2 is not listening'
    assert port.is_listening(11211), 'port 11211/memcached is not listening'

    assert user.exists('ftp'), 'ftp user does not exist'
    assert user.exists('varnish'), 'varnish user does not exist'
    assert user.exists('varnishlog'), 'varnishlog user does not exist'
    assert user.exists('mysql'), 'mysql user does not exist'
    assert user.exists('memcache'), 'memcache user does not exist'
    assert user.exists('wp_user'), 'wp_user user does not exist'
    assert user.exists('wp_user').get('passwd') != '!', 'wp_user pass missing'

    assert process.is_up('apache2'), 'apache2 is not running'
    assert process.is_up('mysqld'), 'mysqld is not running'
    assert process.is_up('varnishd'), 'varnishd is not running'
    assert process.is_up('memcached'), 'memcached is not running'
    assert process.is_up('vsftpd'), 'vsftpd is not running'

    assert service.is_enabled('apache2'), 'apache2 service not enabled'
    assert service.is_enabled('mysql'), 'mysql service not enabled'
    assert service.is_enabled('varnish'), 'varnish service not enabled'
    assert service.is_enabled('varnishlog'), 'varnishlog service not enabled'
    assert service.is_enabled('memcached'), 'memcached service not enabled'
    assert service.is_enabled('vsftpd'), 'vsftpd service not enabled'

    assert http_check('http://localhost/', 'Powered by WordPress')
예제 #9
0
def check():
    env.platform_family = detect.detect()

    # web server is listening
    assert port.is_listening(80), 'Web port 80 is not listening'

    # redis is listening
    assert port.is_listening(6379), 'Redis port 6379 is not listening'
    assert port.is_listening(6380), 'Redis port 6380 is not listening'
    assert port.is_listening(6381), 'Redis port 6381 is not listening'

    # nginx user is created
    assert user.exists("nginx"), 'nginx user does not exist'

    if (env.platform_family == "rhel"):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php-fpm'), 'php-fpm is not enabled'
    elif (env.platform_family == 'debian'):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php5-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php5-fpm'), 'php-fpm is not enabled'

    # magento main page is available
    assert magento_is_responding(), 'Magento did not respond as expected.'
예제 #10
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("mysql-server-5.5")
    assert port.is_listening(3306)
    assert process.is_up("mysqld")
    assert file.exists("/root/.my.cnf")
예제 #11
0
def check():
    env.platform_family = detect.detect()

    # web server is listening
    assert port.is_listening(80), 'Web port 80 is not listening'

    # redis is listening
    assert port.is_listening(6381), 'Redis port 6381 is not listening'

    # nginx user is created
    assert user.exists("nginx"), 'nginx user does not exist'
    
    # domain ftp user is created
    assert user.exists("magento_sftp"), 'magento_sftp user does not exist'

    # processes are running
    assert process.is_up("nginx"), 'nginx is not running'
    assert process.is_up("php-fpm"), 'php-fpm is not running'
    assert process.is_up("redis"), 'redis is not running'
    
    # services are enabled
    assert service.is_enabled("nginx"), 'nginx service not enabled'
    assert service.is_enabled("redis"), 'redis service not enabled'
    assert service.is_enabled("php-fpm"), 'php-fpm not enabled'
    assert service.is_enabled("mysql"), 'database service not enabled'

    # magento main page is available
    assert magento_is_responding(), 'Magento did not respond as expected.'
예제 #12
0
def artifacts():
    env.platform_family = detect.detect()
    artifacts = ['/var/log/messages',
                 '/var/log/syslog',
                 '/var/log/cloud-init.log',
                 '/var/log/cloud-init-output.log']
    get_artifacts(artifacts=artifacts)
예제 #13
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/var/www/vhosts/example.com/httpdocs/xmlrpc.php'),\
        'xmlrpc.php did not exist'

    assert port.is_listening(80), 'port 80/nginx is not listening'

    if (env.platform_family == "rhel"):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php-fpm'), 'php-fpm is not enabled'
    elif (env.platform_family == 'debian'):
        assert process.is_up('nginx'), 'nginx is not running'
        assert process.is_up('php5-fpm'), 'php-fpm is not running'
        assert service.is_enabled('nginx'), 'nginx is not enabled'
        assert service.is_enabled('php5-fpm'), 'php-fpm is not enabled'

    if ("secondary" not in socket.gethostname()):
        assert process.is_up('lsyncd'), 'lsyncd is not running'
        assert service.is_enabled('lsyncd'), 'lsyncd is not enabled'


    assert http_check('http://localhost/', 'Powered by WordPress')
예제 #14
0
def check():
    env.platform_family = detect.detect()

    config_js = '/var/app/current/config.js'
    assert file.exists(config_js), \
        "%s does not exist" % config_js
    assert file_contains(config_js, 'StrictHostKeyChecking false'), \
        "%s does not turn off StrictHostKeyChecking" % config_js

    dot_npm = "/home/my_nodejs_app/.npm"
    assert file.exists(dot_npm), \
        "%s does not exist" % dot_npm
    assert file.is_dir(dot_npm), \
        "%s is not a directory" % dot_npm
    assert file.is_mode(dot_npm, 'r-xr-xr-x'), \
        "%s is not mode 755" % dot_npm
    assert file.owner_is(dot_npm, 'my_nodejs_app'), \
        "%s is not owned by my_nodejs_app" % dot_npm
    # directory { should be_grouped_into 'my_nodejs_app' }

    assert port.is_listening(80), "port 80/apache2 is not listening"

    assert user.exists("my_nodejs_app"), "user my_nodejs_app does not exist"
    assert user_has_shell('my_nodejs_app', ':/bin/bash'), \
        "user should have bash shell"

    assert process.is_up("node"), "node process is not up"
    # its('args') { should match 'server.js|app.js' }

    assert service.is_enabled("my_nodejs_app"), \
        "my_nodejs_app service is not enabled"

    assert apache2_is_responding(), "node demo app did not respond as expected"
예제 #15
0
def artifacts():
    env.platform_family = detect.detect()
    artifacts = [
        '/var/log/messages', '/var/log/syslog', '/var/log/cloud-init.log',
        '/var/log/cloud-init-output.log'
    ]
    get_artifacts(artifacts=artifacts)
def check():
    env.platform_family = detect.detect()

    dot_npm = "/home/user1/.npm"
    assert file.exists(dot_npm), \
        "%s does not exist" % dot_npm
    assert file.is_dir(dot_npm), \
        "%s is not a directory" % dot_npm
    assert file.mode_is(dot_npm, '755'), \
        "%s is not mode 755" % dot_npm
    assert file.owner_is(dot_npm, 'user1'), \
        "%s is not owned by user1" % dot_npm
    # directory { should be_grouped_into 'my_nodejs_app' }

    assert port.is_listening(80), "port 80/apache2 is not listening"

    assert user.exists("user1"), "user my_nodejs_app does not exist"

    assert process.is_up("node"), "node process is not up"
    # its('args') { should match 'server.js|app.js' }

    assert service.is_enabled("node-app"), \
        "node-app service is not enabled"

    assert nodejs_is_responding(), "node demo app did not respond as expected"
예제 #17
0
def check():
    env.platform_family = detect.detect()

    assert file.exists("/etc/chef/validator.pem"), "/etc/chef/validator.pem is missing."
    assert file.exists("/etc/chef/client.rb"), "/etc/chef/client.rb is missing."
    assert file.exists("/etc/chef/first-boot.json"), "/etc/chef/first-boot.json is missing."
    assert file.exists("/usr/bin/chef-client"), "/usr/bin/chef-client is missing."
예제 #18
0
def mysql():
    env.platform_family = detect.detect()

    if env.platform_family == 'debian':
        mysql_package = 'mysql-server-5.5'
        mysql_process = 'mysql'
        holland_package = 'holland'
    elif env.platform_family == 'rhel':
        mysql_package = 'mysql-server'
        mysql_process = 'mysqld'
        holland_package = 'holland'
    else:
        raise ValueError('OS ' + env.platform_family +
                         ' unknown, update tests.')

    packages = [holland_package, mysql_package]
    for pkg in packages:
        assert package.installed(pkg), ('package ' + pkg + 'not found')

    assert port.is_listening(3306), '3306 not listening'

    root_my_cnf = "/root/.my.cnf"
    assert file.exists(root_my_cnf), 'root my.cnf does not exist'
    assert file.mode_is(root_my_cnf, 600), \
        'permissions are wrong on root my.cnf'
    assert file.owner_is(root_my_cnf, "root"), 'owner is wrong on root my.cnf'
    assert process.is_up(mysql_process), 'mysql is not running'
    assert service.is_enabled(mysql_process), 'mysql is not enabled'
예제 #19
0
def check():
    env.platform_family = detect.detect()

    # web server is listening
    assert port.is_listening(80), 'Web port 80 is not listening'

    # redis is listening
    assert port.is_listening(6379), 'Redis port 6379 is not listening'
    assert port.is_listening(6380), 'Redis port 6380 is not listening'
    assert port.is_listening(6381), 'Redis port 6381 is not listening'

    # nginx user is created
    assert user.exists("nginx"), 'nginx user does not exist'

    # processes are running
    assert process.is_up("nginx"), 'nginx is not running'
    assert process.is_up("php-fpm"), 'php-fpm is not running'
    assert process.is_up("redis"), 'redis is not running'
    assert process.is_up("rackspace-monitoring-agent"), 'Monitoring agent is not running'
    assert process.is_up("driveclient"), 'Backup agent is not running'
    
    # holland backups are configured
    assert file.exists("/etc/holland/backupsets/default.conf"), "Backup configuration does not exist"
    assert file.exists("/etc/cron.d/holland"), 'Backup cron job not configured'

    # services are enabled
    assert service.is_enabled("nginx"), 'nginx service not enabled'
    assert service.is_enabled("redis"), 'redis service not enabled'
    assert service.is_enabled("php-fpm"), 'php-fpm not enabled'
    assert service.is_enabled("rackspace-monitoring-agent"), 'monitoring agent not enabled'
    assert service.is_enabled("driveclient"), 'driveclient (backups) not enabled'

    # magento main page is available
    assert magento_is_responding(), 'Magento did not respond as expected.'
예제 #20
0
def holland():
    # Verify hollandbackup package is installed with a default backupset
    env.platform_family = detect.detect()

    assert package.installed("holland")
    assert package.installed("holland-mysqldump")
    assert file.exists("/etc/holland/backupsets/default.conf")
예제 #21
0
def check():
    env.platform_family = detect.detect()

    if env.platform_family == "rhel":
        assert package.installed("httpd"), "httpd not installed"
        assert package.installed("holland"), "holland is not installed"
        assert package.installed("mysql55"), "mysql55 is not insalled"
        assert process.is_up("httpd"), "process httpd not running"
        assert service.is_enabled("httpd"), "httpd not enabled"
        # welcome.conf causes a 403 when running apache_is_responding()
        # with the stock build.

    if env.platform_family == "debian":
        print "Ubuntu 12.04/14.04 or Debian 7.x/8.x"
        assert package.installed("apache2"), "apache2 is not installed"
        assert package.installed("mysql-server-5.5"), ("mysql-server-5.5 not" +
                                                       " installed")
        assert process.is_up("apache2"), "apache2 is not running"
        assert service.is_enabled("apache2"), "apache2 is not enabled"
        assert apache_is_responding(), "apache2 is not responding"

    assert port.is_listening(80), "port 80 not listening"
    assert port.is_listening(443), "port 443 not listening"
    assert port.is_listening(3306), "port 3306 not listening"
    assert phpmyadmin_is_responding(), "phpmyadmin is not responding"
    assert holland_is_running(), "holland cannot run"
예제 #22
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("mysql-server-5.5")
    assert port.is_listening(3306)
    assert process.is_up("mysqld")
    assert file.exists("/root/.my.cnf")
예제 #23
0
def holland():
    # Verify hollandbackup package is installed with a default backupset
    env.platform_family = detect.detect()

    assert package.installed("holland")
    assert package.installed("holland-mysqldump")
    assert file.exists("/etc/holland/backupsets/default.conf")
def check():
    env.platform_family = detect.detect()

    packages = ['st2',
                'st2chatops',
                'st2mistral',
                'st2web',
                'rabbitmq-server',
                'mongodb-org-server',
                'postgresql'
                ]

    services = ['st2api',
                'st2sensorcontainer',
                'mistral',
                'st2resultstracker',
                'rabbitmq-server',
                'mongod',
                'postgresql'
                ]

    for pkg in packages:
        assert package.installed(pkg),\
            "package {0} is not installed".format(pkg)

    for srv in services:
        assert service.is_enabled(srv),\
            "service {0} is not enabled".format(srv)

    assert user.exists("stanley"), "user stanley does not exist"
예제 #25
0
def check():
    env.platform_family = detect.detect()

    site = "http://localhost/"
    string = env.string

    assert file.exists('/var/www/vhosts/application/index.php'), \
        '/var/www/vhosts/application/index.php did not exist'

    assert port.is_listening(80), 'port 80/apache2 is not listening'
    assert port.is_listening(3306), 'port 3306/mysqld is not listening'
    assert port.is_listening(11211), 'port 11211/memcached is not listening'

    assert user.exists('mysql'), 'mysql user does not exist'
    assert user.exists('memcache'), 'memcache user does not exist'

    assert process.is_up('apache2'), 'apache2 is not running'
    assert process.is_up('mysqld'), 'mysqld is not running'
    assert process.is_up('memcached'), 'memcached is not running'

    assert service.is_enabled('apache2'), 'apache2 service not enabled'
    assert service.is_enabled('mysql'), 'mysql service not enabled'
    assert service.is_enabled('memcached'), 'memcached service not enabled'

    assert http_check(site, string), 'Apache is not responding as expected.'
예제 #26
0
파일: lamp.py 프로젝트: CaptBeardie/lamp
def check():
    env.platform_family = detect.detect()
    release = run("/usr/bin/lsb_release -r | awk {'print $2'}")

    if env.platform_family == "rhel":
        if float(release) < 7:
            print "RHEL/Cent 6.x"
            assert package.installed("httpd")
            assert package.installed("holland")
            assert package.installed("mysql55")
            assert port.is_listening(80)
            assert port.is_listening(443)
            assert port.is_listening(3306)
            assert process.is_up("httpd")
            assert service.is_enabled("httpd")
            # welcome.conf causes a 403 when running apache_is_responding()
            # with the stock build.

    if env.platform_family == "debian":
        print "Ubuntu 12.04/14.04 or Debian 7.x"
        assert package.installed("apache2")
        assert package.installed("mysql-server-5.5")
        assert package.installed("apache2")
        assert port.is_listening(80)
        assert port.is_listening(443)
        assert port.is_listening(3306)
        assert process.is_up("apache2")
        assert service.is_enabled("apache2")
        assert apache_is_responding()
예제 #27
0
def memcached():
    env.platform_family = detect.detect()

    assert package.installed("memcached")
    assert port.is_listening(11211)
    assert process.is_up("memcached")
    assert service.is_enabled("memcached")
예제 #28
0
def check():
    env.platform_family = detect.detect()

    assert file.is_dir("/var/www/vhosts")
    assert port.is_listening(80)
    assert package.installed("holland")
    assert drupal_is_responding(), 'Drupal did not respond as expected.'

    apache_process = 'apache2'
    php_package = 'php5'
    mysql_process = 'mysql'

    if env.platform_family == 'debian':
        apache_process = 'apache2'
        php_package = 'php5'
        mysql_process = 'mysql'
    elif env.platform_family == 'rhel':
        apache_process = 'httpd'
        php_package = 'php'
        mysql_process = 'mysqld'
    else:
        raise ValueError('OS ' + env.platform_family +
                         ' unknown, update tests.')

    assert package.installed(php_package)
    assert process.is_up(apache_process)
    assert process.is_up(mysql_process)
    assert service.is_enabled(apache_process)
    assert service.is_enabled(mysql_process)
예제 #29
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/var/www/vhosts/example.com/xmlrpc.php'), 'xmlrpc.php did not exist'

    assert port.is_listening(21), 'port 21/vsftpd is not listening'
    assert port.is_listening(80), 'port 80/varnishd is not listening'
    assert port.is_listening(3306), 'port 3306/mysqld is not listening'
    assert port.is_listening(6082), 'port 6082/varnishd is not listening'
    assert port.is_listening(8080), 'port 8080/apache2 is not listening'
    assert port.is_listening(11211), 'port 11211/memcached is not listening'

    assert user.exists('ftp'), 'ftp user does not exist'
    assert user.exists('varnish'), 'varnish user does not exist'
    assert user.exists('varnishlog'), 'varnishlog user does not exist'
    assert user.exists('mysql'), 'mysql user does not exist'
    assert user.exists('memcache'), 'memcache user does not exist'
    assert user.exists('wp_user'), 'wp_user user does not exist'

    assert process.is_up('apache2'), 'apache2 is not running'
    assert process.is_up('mysqld'), 'mysqld is not running'
    assert process.is_up('varnishd'), 'varnishd is not running'
    assert process.is_up('memcached'), 'memcached is not running'
    assert process.is_up('vsftpd'), 'vsftpd is not running'

    assert service.is_enabled('apache2'), 'apache2 service not enabled'
    assert service.is_enabled('mysql'), 'mysql service not enabled'
    assert service.is_enabled('varnish'), 'varnish service not enabled'
    assert service.is_enabled('varnishlog'), 'varnishlog service not enabled'
    assert service.is_enabled('memcached'), 'memcached service not enabled'
    assert service.is_enabled('vsftpd'), 'vsftpd service not enabled'

    assert wordpress_is_responding(), 'Wordpress did not respond as expected.'
예제 #30
0
파일: lamp.py 프로젝트: jacksonargo/lamp
def check():
    env.platform_family = detect.detect()

    if env.platform_family == "rhel":
        assert package.installed("httpd"), "httpd not installed"
        assert package.installed("holland"), "holland is not installed"
        assert package.installed("mysql55"), "mysql55 is not insalled"
        assert process.is_up("httpd"), "process httpd not running"
        assert service.is_enabled("httpd"), "httpd not enabled"
        # welcome.conf causes a 403 when running apache_is_responding()
        # with the stock build.

    if env.platform_family == "debian":
        print "Ubuntu 12.04/14.04 or Debian 7.x/8.x"
        assert package.installed("apache2"), "apache2 is not installed"
        assert package.installed("mysql-server-5.5"), ("mysql-server-5.5 not" +
                                                       " installed")
        assert process.is_up("apache2"), "apache2 is not running"
        assert service.is_enabled("apache2"), "apache2 is not enabled"
        assert apache_is_responding(), "apache2 is not responding"

    assert port.is_listening(80), "port 80 not listening"
    assert port.is_listening(443), "port 443 not listening"
    assert port.is_listening(3306), "port 3306 not listening"
    assert phpmyadmin_is_responding(), "phpmyadmin is not responding"
    assert holland_is_running(), "holland cannot run"
예제 #31
0
def check():
    env.platform_family = detect.detect()

    for pkg in ["rabbitmq-server",
                "python-pip",
                "curl",
                "unzip",
                "supervisor",
                "dnsmasq"]:
        assert package.installed(pkg), \
            "package {} is not installed".format(pkg)

    for path in ["/var/lib/rabbitmq/.erlang.cookie",
                 "/etc/supervisor/conf.d/consul.conf",
                 "/usr/local/lib/supervisor/start_consul.sh",
                 "/etc/dnsmasq.d/consul_dns.conf"]:
        assert file.exists(path), "file {} does not exist".format(path)

    assert port.is_listening(5672), "port 5672 (RabbitMQ) is not listening"
    assert user.exists("rabbitmq"), "there is no rabbitmq user"
    assert group.is_exists("rabbitmq"), "there is no rabbitmq group"
    assert process.is_up("supervisord"), "supervisord is not running"
    assert process.is_up("consul"), "consul is not running"
    assert process.is_up("epmd"), "epmd is not running"
    assert process.is_up("beam.smp"), "beam.smp is not running"
    assert process.is_up("dnsmasq"), "dnsmasq is not running"
    assert service.is_enabled("rabbitmq-server"), "nginx is not enabled"
    assert service.is_enabled("supervisor"), "supervisor is not enabled"
    assert amqp_works(env.amqp_login, env.amqp_password, env.host), \
        "RabbitMQ did not respond as expected"
예제 #32
0
def check():
    env.platform_family = detect.detect()

    assert file.is_dir("/var/www/vhosts"), '/var/www/vhosts is wrong'
    assert port.is_listening(80), 'port 80 not listening'
    assert port.is_listening(8080), 'port 8080 not listening'
    assert package.installed("varnish"), 'varnish not installed'
    assert drupal_is_responding(), 'Drupal did not respond as expected.'

    apache_process = 'apache2'
    php_package = 'php5'

    if env.platform_family == 'debian':
        apache_process = 'apache2'
        php_package = 'php5'
    elif env.platform_family == 'rhel':
        apache_process = 'httpd'
        php_package = 'php'
    else:
        raise ValueError('OS ' + env.platform_family +
                         ' unknown, update tests.')

    assert package.installed(php_package), 'php not installed'
    assert process.is_up(apache_process), 'apache is not running'
    assert service.is_enabled(apache_process), 'apache is not enabled'
예제 #33
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("lxc-docker")
    assert file.exists("/etc/default/docker")
    assert file.exists("/var/run/docker.sock")
    assert process.is_up("docker")
    assert service.is_enabled("docker")
예제 #34
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("jenkins")
    assert port.is_listening(8080)
    assert user.exists("jenkins")
    assert service.is_enabled("jenkins")
    assert jenkins_is_responding_on_http()
예제 #35
0
def artifacts():
    env.platform_family = detect.detect()

    # Logs to pull
    logs = ['/root/cfn-userdata.log',
            '/root/heat-script.log']

    get_artifacts(logs)
예제 #36
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("memcached")
    assert file.exists("/etc/memcached.conf")
    assert port.is_listening(11212)
    assert process.is_up("memcached")
    assert service.is_enabled("memcached")
예제 #37
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("memcached")
    assert file.exists("/etc/memcached.conf")
    assert port.is_listening(11212)
    assert process.is_up("memcached")
    assert service.is_enabled("memcached")
예제 #38
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("lxc-docker")
    assert file.exists("/etc/default/docker")
    assert file.exists("/var/run/docker.sock")
    assert process.is_up("docker")
    assert service.is_enabled("docker")
예제 #39
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("jenkins"), 'Jenkins is not installed'
    assert port.is_listening(8080), 'Jenkins is not listening'
    assert user.exists("jenkins"), 'Jenkins user does not exist'
    assert service.is_enabled("jenkins"), 'Jenkins service is not enabled'
    assert jenkins_is_responding_on_http(), 'Jenkins is not responding'
예제 #40
0
def monitoring():
    env.platform_family = detect.detect()

    monitor_config = "/etc/rackspace-monitoring-agent.cfg"

    assert package.installed("rackspace-monitoring-agent")
    assert process.is_up("rackspace-monitoring-agent")
    assert service.is_enabled("rackspace-monitoring-agent")
    assert file.exists(monitoring_config)
예제 #41
0
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(80)
    assert port.is_listening(443)
    assert port.is_listening(8888)
    assert process.is_up("nginx")
    assert service.is_enabled("nginx")
    assert ipynb_is_responding()
예제 #42
0
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(3306), 'port 3306/mysql is not listening'

    if (env.platform_family == "rhel"):
        assert process.is_up('mysql'), 'apache is not running'
    elif (env.platform_family == 'debian'):
        assert process.is_up('mysql'), ' is not running'
def check():
  env.platform_family = detect.detect()

  assert port.is_listening(3306), 'port 3306/mysql is not listening'

  if (env.platform_family == "rhel"):
    assert process.is_up('mysql'), 'apache is not running'
  elif (env.platform_family == 'debian'):
    assert process.is_up('mysql'), ' is not running'
예제 #44
0
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(80)
    assert port.is_listening(443)
    assert port.is_listening(8888)
    assert process.is_up("nginx")
    assert service.is_enabled("nginx")
    assert ipynb_is_responding()
예제 #45
0
def monitoring():
    env.platform_family = detect.detect()

    monitor_config = "/etc/rackspace-monitoring-agent.cfg"

    assert package.installed("rackspace-monitoring-agent")
    assert process.is_up("rackspace-monitoring-agent")
    assert service.is_enabled("rackspace-monitoring-agent")
    assert file.exists(monitoring_config)
예제 #46
0
def check():
    env.platform_family = detect.detect()

    assert file.exists("/etc/mongod.conf"), "/etc/mongod.conf does not exist"
    assert port.is_listening(27017), "nothing is listening on port 27017"
    assert user.exists("mongodb"), "there is no mongodb user"
    assert group.is_exists("mongodb"), "there is no mongodb group"
    assert process.is_up("mongod"), "mongod is not running"
    assert service.is_enabled("mongod"), "service mongod is not enabled"
    assert replset_is_ok(), "replica set status was not ok"
예제 #47
0
def apache():
    env.platform_family = detect.detect()

    apache_config = "/etc/apache2/sites-enabled/wordpress.conf"

    assert package.installed("apache2")
    assert process.is_up("apache2")
    assert service.is_enabled("apache2")
    assert port.is_listening(8080)
    assert file.has_line(apache_config, "VirtualHost *:8080")
예제 #48
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("jenkins")
    assert file.exists("/var/lib/jenkins/hudson.model.UpdateCenter.xml")
    assert port.is_listening(8080)
    assert port.is_listening(8081)
    assert user.exists("jenkins")
    assert process.is_up("daemon")
    assert service.is_enabled("jenkins")
    assert jenkins_is_responding_on_http()
예제 #49
0
def varnish():
    env.platform_family = detect.detect()

    varnish_config = "/etc/varnish/default.vcl"

    assert package.installed("varnish")
    assert process.is_up("varnishd")
    assert service.is_enabled("varnish")
    assert port.is_listening(80)
    assert file.has_line(varnish_config, "backend master")
    assert file.has_line(varnish_config, "backend local")
예제 #50
0
파일: galera.py 프로젝트: kmcjunk/galera
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(3306), 'port 3306/mysql is not listening'

    if (env.platform_family == "rhel"):
        assert process.is_up('mysql'), 'galera is not running'
        assert service.is_enabled('mysql'), 'galera is not enabled'
    elif (env.platform_family == 'debian'):
        assert process.is_up('mysql'), 'galera is not running'
        assert service.is_enabled('mysql'), 'galera is not enabled'
예제 #51
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("td-agent")
    assert file.exists("/etc/td-agent/td-agent.conf")
    assert port.is_listening(8888)
    assert port.is_listening(24224)
    assert user.exists("td-agent")
    assert group.is_exists("td-agent")
    assert user.is_belonging_group("td-agent", "td-agent")
    assert process.is_up("ruby")
    assert service.is_enabled("td-agent")
예제 #52
0
def check():
    env.platform_family = detect.detect()

    assert port.is_listening(443), "port 443 (nginx) is not listening"
    assert port.is_listening(8080), "port 8080 (gitlab) is not listening"
    assert port.is_listening(22), "port 22 (ssh) is not listening"
    assert user.exists("git"), "there is no git user"
    assert group.is_exists("git"), "there is no git group"
    assert user.is_belonging_group("git", "git"), "user git is not in the git group"
    assert process.is_up("nginx"), "nginx is not running"
    assert process.is_up("postgres"), "postgres is not running"
    assert process.is_up("redis-server"), "redis-server is not running"
    assert gitlab_is_responding(), "gitlab did not respond as expected"
예제 #53
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("drone"), "Package drone is missing."
    assert file.exists("/etc/drone/drone.toml"), \
        "/etc/drone/drone.toml is missing."
    assert file.exists("/etc/pki/drone/certs/drone.crt"), \
        "SSL certificate missing."
    assert file.exists("/etc/pki/drone/certs/drone.key"), "SSL key missing."
    assert port.is_listening(443), "Port 443 is not listening."
    assert process.is_up("droned"), "The droned process is not running."
    assert service.is_enabled("drone"), "The drone service is not enabled."
    assert drone_is_responding(), "Drone is not responding."
예제 #54
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("apache2")
    assert file.exists("/srv/venv/bin/django-admin.py")
    assert file.exists("/etc/apache2/mods-enabled/wsgi.conf")
    assert file.exists("/etc/apache2/mods-enabled/wsgi.load")
    assert port.is_listening(80)
    assert user.exists("pydev")
    assert group.is_exists("pydev")
    assert user.is_belonging_group("pydev", "pydev")
    assert process.is_up("apache2")
    assert service.is_enabled("apache2")
예제 #55
0
def apache():
    env.platform_family = detect.detect()

    apache_config = "/etc/apache2/sites-enabled/wordpress.conf"
    web_user = "******"
    www_dir = "/var/www/vhosts/example.com"

    assert package.installed("apache2")
    assert process.is_up("apache2")
    assert service.is_enabled("apache2")
    assert port.is_listening(8080)
    assert file.has_line(apache_config, "VirtualHost *:8080")
    assert file.owner_is(www_dir, web_user)
예제 #56
0
def mysql():
    env.platform_family = detect.detect()

    packages = ["holland", "mysql-server"]
    for pkg in packages:
        assert package.installed(pkg)

    assert port.is_listening(3306)
    assert process.is_up("mysqld")

    root_my_cnf = "/root/.my.cnf"
    assert file.exists(root_my_cnf)
    assert file.mode_is(root_my_cnf, 600)
    assert file.owner_is(root_my_cnf, "root")