CiscoCloud / distributive

Unit testing for the cloud
Apache License 2.0
147 stars 20 forks source link

Execute scripts with Distributive #87

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'm trying to add some tests for etcd. As far as I understood it's not possible to run external scripts with Distributive. For example, I want to check if leader was elected or if I can write to a particular etcd member. Is it possible with Distributive and what is the correct way to do that?

Here is an example of such check:

{
    "Name": "etcd health check",
    "Notes": "For use with Microservice Infrastructure",
    "Checklist" : [
        {
            "Name": "etcd peer port",
            "Check": "TCP",
            "Parameters": ["localhost:2380"]
        },
        {
            "Name": "consul-check-etcd-member script existence",
            "Check": "file",
            "Parameters": ["/usr/local/bin/check-etcd-member"]
        }
    ]
}

I can check that script exists but I seem cannot run it.

Basically, it's possible to register such checks with a Consul service, but my point is to move all the checks to be run by Distributive.

Thanks.

langston-barrett commented 8 years ago

@loshkovskyi You're looking for the "command" check, under Misc.. So your JSON would look something like this:

        {
            "Name": "consul-check-etcd-member script",
            "Check": "command",
            "Parameters": ["./usr/local/bin/check-etcd-member"]
        }

Let me know if that helps!

ghost commented 8 years ago

Thank you, I should have read that wiki page.