Beispiel #1
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.'
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"
Beispiel #3
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"
Beispiel #4
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."
Beispiel #5
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")
Beispiel #6
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")
Beispiel #7
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/drone/ssl/drone.crt"), "SSL certificate missing."
    assert file.exists("/etc/drone/ssl/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."
Beispiel #8
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")
Beispiel #9
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."
Beispiel #10
0
def check_app():
    env.platform_family = detect.detect()

    assert file.exists("/home/rails/railsapp/current/config/database.yml"), \
        "database.yml does not exist"
    assert file.exists("/etc/nginx/sites-enabled/railsapp"), \
        "nginx proxy is not configured"
    assert port.is_listening(80), "port 80 is not listening"
    assert user.exists("rails"), "user rails does not exist"
    assert group.is_exists("rails"), "group rails does not exist"
    # envassert uses `ps -A`, which shows `ruby` for the unicorn process name
    assert process.is_up("ruby"), "unicorn process is not up"
    assert service.is_enabled("unicorn"), "unicorn is not enabled"
    assert service.is_enabled("nginx"), \
        "nginx is not enabled"
Beispiel #11
0
def check_master():
    env.platform_family = detect.detect()

    assert file.exists("/etc/redis/master.conf"), \
        "master.conf does not exist"
    assert file.exists("/etc/redis/sentinel_cluster.conf"), \
        "sentinel_cluster.conf does not exist"
    assert port.is_listening(6379), "port 6379 is not listening"
    assert port.is_listening(26379), "port 26379 is not listening"
    assert user.exists("redis"), "user redis does not exist"
    assert group.is_exists("redis"), "group redis does not exist"
    assert process.is_up("redis-server"), "redis-server process is not up"
    assert service.is_enabled("redismaster"), "redismaster is not enabled"
    assert service.is_enabled("redis_sentinel_cluster"), \
        "redis_sentinel_cluster is not enabled"
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"
Beispiel #13
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.'
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"
Beispiel #15
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")
Beispiel #16
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")
Beispiel #17
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")
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')
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"
Beispiel #20
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
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')
Beispiel #22
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.'
Beispiel #23
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'
Beispiel #24
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")
Beispiel #25
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/home/strongloop/loopback-example-app/package.json'), \
        '/home/strongloop/loopback-example-app/package.json does not exist'
    assert file.exists('/etc/supervisor.d/strongloop.conf'), \
        '/etc/supervisor.d/strongloop.conf does not exist'

    assert port.is_listening(3000), 'port 3000/node is not listening'

    assert user.exists('strongloop'), 'user strongbad does not exist'
    assert group.is_exists('strongloop'), 'group strongloop does not exist'

    assert process.is_up('supervisord'), 'process supervisord is not running'
    assert process.is_up('node'), 'process node is not running'

    assert service.is_enabled('supervisor'), 'service supervisor is not enabled'
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")
    def disabled_test_hello_systemvm_envassert(self):
        """Test we can run envassert assertions on the systemvm"""
        assert file.exists('/etc/hosts')

        for packageName in ['dnsmasq', 'haproxy', 'keepalived', 'curl']:
            assert package.installed(packageName), 'package %s should be installed' % packageName

        assert user.exists('cloud'), 'user cloud should exist'
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")
Beispiel #29
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("nginx")
    assert package.installed("mysql-server-5.5")
    assert file.exists("/usr/local/bin/node")
    assert file.exists("/usr/local/bin/npm")
    assert port.is_listening(80)
    assert port.is_listening(2368)
    assert port.is_listening(3306)
    assert user.exists("ghost")
    assert group.is_exists("ghost")
    assert user.is_belonging_group("ghost", "www-data")
    assert process.is_up("nginx")
    assert process.is_up("node")
    assert process.is_up("mysqld")
    assert service.is_enabled("nginx")
    assert service.is_enabled("mysqld")
Beispiel #30
0
def check():
    env.platform_family = detect.detect()

    assert file.exists("/etc/redis/redis.conf")
    assert port.is_listening(6379)
    assert user.exists("redis")
    assert group.is_exists("redis")
    assert process.is_up("redis-server")
    assert service.is_enabled("redisredis")
Beispiel #31
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)
Beispiel #32
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/home/strongloop/loopback-example-app/package.json'), \
        '/home/strongloop/loopback-example-app/package.json does not exist'
    assert file.exists('/etc/supervisor.d/strongloop.conf'), \
        '/etc/supervisor.d/strongloop.conf does not exist'

    assert port.is_listening(3000), 'port 3000/node is not listening'

    assert user.exists('strongloop'), 'user strongbad does not exist'
    assert group.is_exists('strongloop'), 'group strongloop does not exist'

    assert process.is_up('supervisord'), 'process supervisord is not running'
    assert process.is_up('node'), 'process node is not running'

    assert service.is_enabled('supervisor'), \
        'service supervisor is not enabled'
    def disabled_test_hello_systemvm_envassert(self):
        """Test we can run envassert assertions on the systemvm"""
        assert file.exists('/etc/hosts')

        for packageName in ['dnsmasq', 'haproxy', 'keepalived', 'curl']:
            assert package.installed(
                packageName), 'package %s should be installed' % packageName

        assert user.exists('cloud'), 'user cloud should exist'
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)
Beispiel #35
0
def check_db_mysql():
    env.platform_family = detect.detect()

    assert file.exists("/etc/mysql/my.cnf"), \
        "/etc/mysql/my.cnf does not exist"
    assert port.is_listening(3306), "port 3306 is not listening"
    assert user.exists("mysql"), "user mysql does not exist"
    assert group.is_exists("mysql"), "group mysql does not exist"
    assert process.is_up("mysqld"), "mysqld process is not up"
    assert service.is_enabled("mysql"), "mysql is not enabled"
Beispiel #36
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"
Beispiel #37
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"
Beispiel #38
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("cassandra")
    assert file.exists("/etc/cassandra/cassandra.yaml")
    assert port.is_listening(7000)
    assert user.exists("cassandra")
    assert group.is_exists("cassandra")
    assert user.is_belonging_group("cassandra", "cassandra")
    assert process.is_up("java")
    assert service.is_enabled("cassandra")
Beispiel #39
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("nginx")
    assert package.installed("mysql-server-5.5")
    assert file.exists("/srv/git/gitlab/vendor/bundle/ruby/1.9.1/bin/unicorn_rails")
    assert file.exists("/srv/git/bin/ruby")
    assert port.is_listening(80)
    assert port.is_listening(443)
    assert port.is_listening(3306)
    assert port.is_listening(6379)
    assert user.exists("git")
    assert group.is_exists("git")
    assert user.is_belonging_group("git", "git")
    assert process.is_up("nginx")
    assert process.is_up("mysqld")
    assert process.is_up("redis-server")
    assert service.is_enabled("nginx")
    assert service.is_enabled("mysqld")
    assert service.is_enabled("gitlab")
Beispiel #40
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()
Beispiel #41
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("nginx"), 'nginx not installed'
    assert package.installed("mysql-server-5.5"), \
        'mysql-server-5.5 not installed'
    assert file.exists("/usr/local/bin/node"), 'node not found'
    assert file.exists("/usr/local/bin/npm"), 'npm not found'
    assert port.is_listening(80), '80/nginx is not listening'
    assert port.is_listening(2368), '2368/node is not listening'
    assert port.is_listening(3306), '3306/mysqld is not listening'
    assert user.exists("ghost"), 'ghost user does not exist'
    assert group.is_exists("ghost"), 'ghost group does not exist'
    assert user.is_belonging_group("ghost", "www-data"), \
        'ghost user not in group www-data'
    assert process.is_up("nginx"), 'nginx is not running'
    assert process.is_up("node"), 'node is not running'
    assert process.is_up("mysqld"), 'mysqld is not running'
    assert service.is_enabled("nginx"), 'nginx service not enabled'
    assert service.is_enabled("mysqld"), 'mysqld service not enabled'
    assert ghost_is_responding(), 'Ghost did not respond as expected'
Beispiel #42
0
def phpmyadmin_is_responding():
    assert file.exists('/root/.phpmyadminpass'), ("/root/.phpmyadminpass" +
                                                  " not found")
    credentials = ''
    with hide('running', 'stdout'):
        credentials = run("cat /root/.phpmyadminpass")
    htuser = credentials.split(' ')[0]
    htpass = credentials.split(' ')[1]
    with hide('running', 'stdout'):
        phpmyadmin = run("curl -IL http://localhost/phpmyadmin -u '" + htuser +
                         ":" + htpass + "'")
        return True
Beispiel #43
0
def phpmyadmin_is_responding():
    assert file.exists('/root/.phpmyadminpass'), ("/root/.phpmyadminpass" +
                                                  " not found")
    credentials = ''
    with hide('running', 'stdout'):
        credentials = run("cat /root/.phpmyadminpass")
    htuser = credentials.split(' ')[0]
    htpass = credentials.split(' ')[1]
    with hide('running', 'stdout'):
        phpmyadmin = run("curl -IL http://localhost/phpmyadmin -u '" +
                         htuser + ":" + htpass + "'")
        return True
Beispiel #44
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")
Beispiel #45
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")
Beispiel #46
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("chef-server-core")
    assert file.exists("/etc/opscode/chef-server.rb")
    assert port.is_listening(80)
    assert port.is_listening(443)
    assert user.exists("opscode")
    assert group.is_exists("opscode")
    assert user.is_belonging_group("opscode", "opscode")
    assert process.is_up("nginx")
    assert process.is_up("postgres")
    assert service.is_enabled("nginx")
    assert service.is_enabled("postgres")
Beispiel #47
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/srv/minecraft/minecraft_server.1.8.jar'), \
        '/srv/minecraft/minecraft_server.1.8.jar does not exist'

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

    assert user.exists('mcserver'), 'user mcserver does not exist'

    assert group.is_exists('mcserver'), 'group mcserver does not exist'

    assert process.is_up('java'), 'process java is not running'

    assert service.is_enabled('minecraft'), 'service minecraft is not enabled'
Beispiel #48
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("java-common")
    assert package.installed("nginx")
    assert file.exists("/usr/local/bin/elasticsearch")
    assert port.is_listening(9200)
    assert port.is_listening(9300)
    assert port.is_listening(8080)
    assert user.exists("elasticsearch")
    assert group.is_exists("elasticsearch")
    assert user.is_belonging_group("elasticsearch", "elasticsearch")
    assert process.is_up("java")
    assert process.is_up("nginx")
    assert service.is_enabled("nginx")
    assert service.is_enabled("elasticsearch")
Beispiel #49
0
def check():
    env.platform_family = detect.detect()

    assert package.installed("apache2")
    assert package.installed("memcached")
    assert file.is_dir("/opt/graphite")
    assert file.exists("/etc/sv/statsd")
    assert port.is_listening(443)
    assert port.is_listening(2003)
    assert port.is_listening(2004)
    assert port.is_listening(8126)
    assert user.exists("statsd")
    assert process.is_up("apache2")
    assert process.is_up("memcached")
    assert service.is_enabled("apache2")
    assert service.is_enabled("memcached")
    assert graphite_is_responding()
Beispiel #50
0
def check():
    env.platform_family = detect.detect()

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

    assert port.is_listening(80), 'port 80 is not listening'
    assert port.is_listening(443), 'port 443 is not listenging'
    assert port.is_listening(9001), 'port 9001 is not listening'

    assert user.exists("magento"), 'magento user does not exist'

    assert process.is_up("nginx"), 'nginx is not running'
    assert process.is_up("php5-fpm"), 'php5-fpm is not running'

    assert service.is_enabled("nginx"), 'nginx service not enabled'
    assert service.is_enabled("php5-fpm"), 'php5-fpm service not enabled'

    assert magento_is_responding(), 'Magento did not respond as expected.'
Beispiel #51
0
def check():
    env.platform_family = detect.detect()

    assert file.exists("/etc/apache2/sites-enabled/example.com.conf"), \
        "/etc/apache2/sites-enabled/example.com.conf does not exist"

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

    assert user.exists("memcache"), "user memcache does not exist"

    assert group.is_exists("memcache"), "group memcache does not exist"

    assert process.is_up("apache2"), "apache2 process is not up"
    assert process.is_up("memcached"), "memcached process is not up"

    assert service.is_enabled("apache2"), "redismaster is not enabled"
    assert service.is_enabled("memcached"), "memcached is not enabled"

    assert apache2_is_responding(), "php app did not respond as expected"
Beispiel #52
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/home/rails/railsapp/current/config/database.yml'), \
        '/home/rails/railsapp/current/config/database.yml did not exist'

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

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

    assert process.is_up('ruby'), 'unicorn is not running'
    assert process.is_up('nginx'), 'nginx is not running'
    assert process.is_up('mysqld'), 'mysqld is not running'

    assert service.is_enabled('nginx'), 'nginx service not enabled'
    assert service.is_enabled('mysql'), 'mysql service not enabled'
    assert service.is_enabled('unicorn'), 'unicorn service not enabled'

    assert app_is_responding(), 'Rails app did not respond as expected.'
def check():
    env.platform_family = detect.detect()

    site = 'http://{0}/owncloud'.format(env.host)
    string = 'Files - ownCloud'

    assert file.exists("/var/www/owncloud/config/autoconfig.php"), \
        '/var/www/owncloud/config/autoconfig.php does not exist'

    assert port.is_listening(3306), 'port 3306/mysqld is not listening'
    assert port.is_listening(25), 'port 25/master is not listening'
    assert port.is_listening(443), 'port 443/apache2 is not listening'
    assert port.is_listening(80), 'port 80/apache2 is not listening'

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

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

    assert http_check(site, string), 'owncloud did not respond as expected'
Beispiel #54
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 service.is_enabled('lsyncd'), 'lsyncd is not enabled'
Beispiel #55
0
def check():
    env.platform_family = detect.detect()

    assert file.exists('/var/www/magento/.configured'), \
        '.configured did not exist'

    if env.platform_family == 'rhel':
        memcache_user = '******'
        php_fpm_process_name = 'php-fpm'
        php_fpm_service_name = 'php-fpm'
    elif env.platform_family == 'debian':
        memcache_user = '******'
        php_fpm_process_name = 'php5-fpm'
        php_fpm_service_name = 'php5-fpm'

    assert port.is_listening(80), 'port 80 is not listening'
    assert port.is_listening(443), 'port 443 is not listenging'
    assert port.is_listening(3306), 'port 3306 is not listening'
    assert port.is_listening(9001), 'port 9001 is not listening'
    assert port.is_listening(11211), 'port 11211 is not listening'
    assert port.is_listening(11212), 'port 11212 is not listening'

    assert user.exists("magento"), 'magento user does not exist'
    assert user.exists("mysql"), 'mysql user does not exist'
    assert user.exists(memcache_user), \
        '{} user does not exist'.format(memcache_user)

    assert process.is_up("nginx"), 'nginx is not running'
    assert process.is_up("mysqld"), 'mysqld is not running'
    assert process.is_up(php_fpm_process_name), \
        '{} is not running'.format(php_fpm_process_name)
    assert process.is_up("memcached"), 'memcached is not running'

    assert service.is_enabled("nginx"), 'nginx service not enabled'
    assert service.is_enabled("mysql"), 'mysql service not enabled'
    assert service.is_enabled(php_fpm_service_name), \
        '{} not enabled'.format(php_fpm_service_name)
    assert service.is_enabled("memcached"), 'memcached service not enabled'

    assert magento_is_responding(), 'Magento did not respond as expected.'