tempest.lib.ex.BadRequest

Here are the examples of the python api tempest.lib.ex.BadRequest taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

199 Examples 7

Example 1

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_expected_codes
    @test.attr(type='negative')
    def test_update_health_monitor_empty_expected_codes(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), expected_codes='')

Example 2

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_invalid_protocol
    @test.attr(type='negative')
    def test_create_listener_invalid_protocol(self):
        """Test create listener with an invalid protocol"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id=self.load_balancer_id,
                          protocol_port=self.port,
                          protocol="UDP")
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 3

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_max_url_path
    @test.attr(type='negative')
    def test_create_health_monitor_empty_max_url_path(self):
        """Test create health monitor with empty url_path"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), url_path='')

Example 4

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_timeout
    @test.attr(type='negative')
    def test_update_health_monitor_empty_timeout(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), timeout='')

Example 5

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_delay
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_delay(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), delay='blah')

Example 6

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_max_retries
    @test.attr(type='negative')
    def test_create_health_monitor_empty_max_retries(self):
        """Test create health monitor with empty max_retries"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries='', timeout=5,
                          pool_id=self.pool.get('id'))

Example 7

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_missing_field_loadbalancer
    @test.attr(type='negative')
    def test_create_listener_missing_field_loadbalancer(self):
        """Test create listener with a missing required field loadbalancer"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          protocol_port=self.port,
                          protocol=self.protocol)
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 8

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_pool_id
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_pool_id(self):
        """Test create health monitor with invalid pool id"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id='blah')

Example 9

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_invalid_tenant_id
    @test.attr(type='negative')
    def test_create_listener_invalid_tenant_id(self):
        """Test create listener with an invalid tenant id"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id=self.load_balancer_id,
                          protocol_port=self.port,
                          protocol=self.protocol,
                          tenant_id="&^%123")
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 10

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_expected_codes
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_expected_codes(self):
        """Test if a non_admin user can create a health monitor with invalid
        expected_codes
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), expected_codes='blah'
                          )

Example 11

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_admin_state_up
    @test.attr(type='negative')
    def test_update_health_monitor_empty_admin_state_up(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), admin_state_up='')

Example 12

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_max_retries
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_max_retries(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), max_retries='blah')

Example 13

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_delay
    @test.attr(type='negative')
    def test_create_health_monitor_empty_delay(self):
        """Test create health monitor with empty delay"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay='', max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 14

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_empty_http_method
    @test.attr(type='negative')
    def test_update_health_monitor_empty_empty_http_method(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), http_method='')

Example 15

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_max_retries
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_max_retries(self):
        """Test create health monitor with invalid max_retries"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries='blah', timeout=5,
                          pool_id=self.pool.get('id'))

Example 16

Project: neutron-lbaas Source File: test_health_monitor_admin.py
Function: test_create_health_monitor_empty_tenant_id_field
    @test.attr(type='negative')
    def test_create_health_monitor_empty_tenant_id_field(self):
        """
        Test with admin user creating health monitor with an empty tenant id
        field should fail.
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10,
                          timeout=5,
                          pool_id=self.pool.get('id'),
                          tenant_id="")

Example 17

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_max_admin_state_up
    @test.attr(type='negative')
    def test_create_health_monitor_empty_max_admin_state_up(self):
        """Test create health monitor with empty admin_state_up"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), admin_state_up='')

Example 18

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_missing_field_protocol_port
    @test.attr(type='negative')
    def test_create_listener_missing_field_protocol_port(self):
        """Test create listener with a missing required field protocol_port"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id=self.load_balancer_id,
                          protocol=self.protocol)
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 19

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_missing_required_field_pool_id
    @test.attr(type='smoke')
    def test_create_health_monitor_missing_required_field_pool_id(self):
        """Test if a non_admin user can create a health monitor with pool_id
        missing
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5)

Example 20

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_invalid_admin_state_up
    @test.attr(type='negative')
    def test_create_listener_invalid_admin_state_up(self):
        """Test update listener with an invalid admin_state_up"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          protocol_port=self.port,
                          protocol=self.protocol,
                          admin_state_up="abc123")
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 21

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_attribute
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_attribute(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), max_retries='blue')

Example 22

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_admin_state_up
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_admin_state_up(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), admin_state_up='blah')

Example 23

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_tenant_id
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_tenant_id(self):
        """Test create health monitor with invalid tenant_id"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          tenant_id='blah',
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 24

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_timeout
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_timeout(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), timeout='blah')

Example 25

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_url_path
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_url_path(self):
        """Test if a non_admin user can create a health monitor with invalid
        url_path
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), url_path='blah'
                          )

Example 26

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_expected_codes
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_expected_codes(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), expected_codes='blah')

Example 27

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_http_method
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_http_method(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), http_method='blah')

Example 28

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_type
    @test.attr(type='negative')
    def test_create_health_monitor_empty_type(self):
        """Test create health monitor with empty type"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 29

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_delay
    @test.attr(type='negative')
    def test_update_health_monitor_empty_delay(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), empty_delay='')

Example 30

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_delay
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_delay(self):
        """Test create health monitor with invalid delay"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay='blah', max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 31

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_max_retries
    @test.attr(type='negative')
    def test_update_health_monitor_empty_max_retries(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), max_retries='')

Example 32

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_timeout
    @test.attr(type='negative')
    def test_create_health_monitor_empty_timeout(self):
        """Test create health monitor with empty timeout"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout='',
                          pool_id=self.pool.get('id'))

Example 33

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_empty_url_path
    @test.attr(type='negative')
    def test_update_health_monitor_empty_url_path(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), http_method='')

Example 34

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_missing_required_field_max_retries
    @test.attr(type='smoke')
    def test_create_health_monitor_missing_required_field_max_retries(self):
        """Test if a non_admin user can create a health monitor with max_retries
        missing
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, timeout=5,
                          pool_id=self.pool.get('id'))

Example 35

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_extra_attribute
    @test.attr(type='smoke')
    def test_update_health_monitor_extra_attribute(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), protocol='UDP')

Example 36

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_max_pool_id
    @test.attr(type='negative')
    def test_create_health_monitor_empty_max_pool_id(self):
        """Test create health monitor with empty pool_id"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id='')

Example 37

Project: neutron-lbaas Source File: test_listeners_admin.py
Function: test_create_listener_empty_tenant_id
    @test.attr(type='negative')
    def test_create_listener_empty_tenant_id(self):
        """Test create listener with an empty tenant id should fail"""
        create_new_listener_kwargs = self.create_listener_kwargs
        create_new_listener_kwargs['protocol_port'] = 8081
        create_new_listener_kwargs['tenant_id'] = ""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          **create_new_listener_kwargs)
        self._check_status_tree(
            load_balancer_id=self.load_balancer_id,
            listener_ids=[self.listener_id])

Example 38

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_timeout
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_timeout(self):
        """Test create health monitor with invalid timeout"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout='blah',
                          pool_id=self.pool.get('id'))

Example 39

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_missing_field_protocol
    @test.attr(type='negative')
    def test_create_listener_missing_field_protocol(self):
        """Test create listener with a missing required field protocol"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id=self.load_balancer_id,
                          protocol_port=self.port)
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 40

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_max_http_method
    @test.attr(type='negative')
    def test_create_health_monitor_empty_max_http_method(self):
        """Test create health monitor with empty http_method"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), http_method='')

Example 41

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_invalid_load_balancer_id
    @test.attr(type='negative')
    def test_create_listener_invalid_load_balancer_id(self):
        """Test create listener with an invalid load_balancer_id"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id="234*",
                          protocol_port=self.port,
                          protocol=self.protocol)
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 42

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_missing_required_field_delay
    @test.attr(type='smoke')
    def test_create_health_monitor_missing_required_field_delay(self):
        """Test if a non_admin user can create a health monitor with delay
        missing
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 43

Project: neutron-lbaas Source File: test_listeners_non_admin.py
Function: test_create_listener_invalid_protocol_port
    @test.attr(type='negative')
    def test_create_listener_invalid_protocol_port(self):
        """Test create listener with an invalid protocol_port"""
        self.assertRaises(ex.BadRequest,
                          self._create_listener,
                          loadbalancer_id=self.load_balancer_id,
                          protocol_port="9999999",
                          protocol=self.protocol)
        self._check_status_tree(load_balancer_id=self.load_balancer_id,
                                listener_ids=[self.listener_id])

Example 44

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_empty_expected_codes
    @test.attr(type='negative')
    def test_create_health_monitor_empty_expected_codes(self):
        """Test create health monitor with empty expected_codes"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), expected_codes='')

Example 45

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_admin_state_up
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_admin_state_up(self):
        """Test if a non_admin user can create a health monitor with invalid
        admin_state_up
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), admin_state_up='blah'
                          )

Example 46

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_missing_required_field_type
    @test.attr(type='smoke')
    def test_create_health_monitor_missing_required_field_type(self):
        """Test if a non_admin user can create a health monitor with type
        missing
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 47

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_missing_required_field_timeout
    @test.attr(type='smoke')
    def test_create_health_monitor_missing_required_field_timeout(self):
        """Test if a non_admin user can create a health monitor with timeout
        missing
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10,
                          pool_id=self.pool.get('id'))

Example 48

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_type
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_type(self):
        """Test create health monitor with invalid type"""
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='blah', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'))

Example 49

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_create_health_monitor_invalid_http_method
    @test.attr(type='negative')
    def test_create_health_monitor_invalid_http_method(self):
        """Test if a non_admin user can create a health monitor with invalid
        http_method
        """
        self.assertRaises(ex.BadRequest, self._create_health_monitor,
                          type='HTTP', delay=3, max_retries=10, timeout=5,
                          pool_id=self.pool.get('id'), http_method='blah')

Example 50

Project: neutron-lbaas Source File: test_health_monitors_non_admin.py
Function: test_update_health_monitor_invalid_url_path
    @test.attr(type='negative')
    def test_update_health_monitor_invalid_url_path(self):
        hm = self._create_health_monitor(**self.create_basic_hm_kwargs)
        self.assertRaises(ex.BadRequest,
                          self._update_health_monitor,
                          hm.get('id'), url_path='blah')
See More Examples - Go to Next Page
Page 1 Selected Page 2 Page 3 Page 4