This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Test your servers environments by using fabric.

Requirements

  • python 2.6 or later
  • fabric

How to Use

  1. install

    % pip install envassert
    
  2. write fabfile.py.

    from fabric.api import env, task
    from envassert import file, process, package, user, group, port, cron, detect
    
    env.use_ssh_config = True
    
    @task
    def check():
        env.platform_family = detect.detect()
    
        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")
        assert file.group_is("/bin/sh", "root")
        assert file.mode_is("/bin/sh", "777")
    
        if env.platform_family == "freebsd":
            assert file.is_link("/compat")
        else:
            assert file.is_link("/usr/tmp")
    
        assert package.installed("wget.x86_64")
    
        assert user.exists("sshd")
        assert user.is_belonging_group("shirou", "users")
        assert group.exists("wheel")
    
        assert port.is_listening(22)
        assert port.is_listening(80, "tcp")
    
        assert process.is_up("http") is False
        assert service.is_enabled("httpd")
    
        assert cron.has_entry('shirou', 'python')
    
        assert filesystem.is_type('ext4', '/')
    
  3. run fab

    % fab -H somehost check
    [somehost] Executing task 'check'
    
    Done.
    Disconnecting from root@192.168.22.98... done.
    

    You can use any other fabric arguments like hosts or parallel.

Detecting OS

The detect.detect() function can detect target OS and distribution. Setting this variable to env.platform_family, functions can dispatch according to that value.

This function is a minimal port of ohai.

Currently, these platform can be detected. (but not tested yet)

  • rhel (redhat, centos, oracle, scientific, enterpriseenterprise, amazon)
  • debian (debian, ubuntu, linuxmint, raspbian)
  • fedora
  • suse
  • gentoo
  • arch
  • freebsd
  • netbsd
  • openbsd
  • darwin

However, every functions are not implemented for these all platform. Pull Requests are welcome.

The giants on whose shoulders this works stands

License

MIT License

FYI

  • cuisine: BSD
  • serverspec: MIT
  • ohai: Apache 2
Release History

Release History

0.1.10

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
envassert-0.1.10.tar.gz (7.7 kB) Copy SHA256 Checksum SHA256 Source Dec 5, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting