Example #1
0
func (s *poolSuite) TestListFilterInvalidProvidersAndNames(c *gc.C) {
	err := apiserverstorage.ValidatePoolListFilter(
		s.api,
		params.StoragePoolFilter{
			Providers: []string{invalidProvider},
			Names:     []string{invalidName}})
	c.Assert(err, gc.ErrorMatches, `storage provider "invalid" not found`)
}
Example #2
0
func (s *poolSuite) TestListFilterInvalidProvidersAndValidNames(c *gc.C) {
	err := apiserverstorage.ValidatePoolListFilter(
		s.api,
		params.StoragePoolFilter{
			Providers: []string{invalidProvider},
			Names:     []string{validName}})
	c.Assert(err, gc.ErrorMatches, ".*not supported.*")
}
Example #3
0
func (s *poolSuite) TestListFilterValidProvidersAndNames(c *gc.C) {
	s.registerProviders(c)
	err := apiserverstorage.ValidatePoolListFilter(
		s.api,
		params.StoragePoolFilter{
			Providers: []string{validProvider},
			Names:     []string{validName}})
	c.Assert(err, jc.ErrorIsNil)
}
Example #4
0
func (s *poolSuite) TestListFilterEmpty(c *gc.C) {
	err := apiserverstorage.ValidatePoolListFilter(s.api, params.StoragePoolFilter{})
	c.Assert(err, jc.ErrorIsNil)
}