config: add test for OpenStack SD (#4594)

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2018-09-13 18:14:27 +02:00 committed by Goutham Veeramachaneni
parent 05726c5ea2
commit 128ff546b8
3 changed files with 8 additions and 1 deletions

View file

@ -695,6 +695,9 @@ var expectedErrors = []struct {
}, {
filename: "marathon_authtoken_bearertoken.bad.yml",
errMsg: "marathon_sd: at most one of bearer_token, bearer_token_file, auth_token & auth_token_file must be configured",
}, {
filename: "openstack_role.bad.yml",
errMsg: "unknown OpenStack SD role",
}, {
filename: "url_in_targetgroup.bad.yml",
errMsg: "\"http://bad\" is not a valid hostname",

View file

@ -0,0 +1,4 @@
scrape_configs:
- openstack_sd_configs:
- role: invalid

View file

@ -84,7 +84,7 @@ func (c *Role) UnmarshalYAML(unmarshal func(interface{}) error) error {
case OpenStackRoleHypervisor, OpenStackRoleInstance:
return nil
default:
return fmt.Errorf("Unknown OpenStack SD role %q", *c)
return fmt.Errorf("unknown OpenStack SD role %q", *c)
}
}