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"
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"
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'
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)
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 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()