コード例 #1
0
 def _check_volume_transfer_presence():
     try:
         self._client.get(transfer.id)
         is_present = True
     except exceptions.NotFound:
         is_present = False
     return expect_that(is_present, equal_to(must_present))
コード例 #2
0
ファイル: volumes.py プロジェクト: hayderimran7/stepler
 def is_old_host_volume_absent():
     page_volumes.refresh()
     page_volumes.label_volumes.click()
     return expect_that(
         page_volumes.tab_volumes.table_volumes.row(
             name=volume_name, host=old_host).is_present,
         equal_to(False))
コード例 #3
0
 def _check_snapshots_presence():
     # Make a dict with actual presence values for each snapshot
     actual_presence = dict.fromkeys(snapshot_ids, False)
     for snapshot in self._client.list():
         if snapshot.id in actual_presence:
             actual_presence[snapshot.id] = True
     return expect_that(actual_presence, equal_to(expected_presence))
コード例 #4
0
 def _check_agents_alive():
     agents = [
         agent for agent in self.get_agents()
         if agent['id'] in agents_ids
     ]
     return expect_that(agents,
                        only_contains(has_entries(alive=must_alive)))
コード例 #5
0
ファイル: backups.py プロジェクト: hayderimran7/stepler
 def _check_backup_presence():
     try:
         self._client.get(backup.id)
         is_present = True
     except exceptions.NotFound:
         is_present = False
     return expect_that(is_present, equal_to(must_present))
コード例 #6
0
ファイル: v2.py プロジェクト: hayderimran7/stepler
        def _check_image_presence():
            try:
                self._client.images.get(image.id)
                is_present = True
            except exc.NotFound:
                is_present = False

            return expect_that(is_present, equal_to(must_present))
コード例 #7
0
ファイル: stacks.py プロジェクト: hayderimran7/stepler
        def _check_presence():
            try:
                get_stack()
                is_present = True
            except exc.NotFound:
                is_present = False

            return expect_that(is_present, equal_to(must_present))
コード例 #8
0
ファイル: users.py プロジェクト: hayderimran7/stepler
        def _check_user_in_group():
            try:
                user_is_in_group = self._client.check_in_group(user=user,
                                                               group=group)
            except exceptions.NotFound:
                user_is_in_group = False

            return expect_that(user_is_in_group, equal_to(must_present))
コード例 #9
0
ファイル: flavors.py プロジェクト: hayderimran7/stepler
 def _check_flavor_presence():
     try:
         # After deleting flavor `get` method still return object,
         # so it was changed to find
         self._client.find(id=flavor.id)
         is_present = True
     except exceptions.NotFound:
         is_present = False
     return expect_that(is_present, equal_to(must_present))
コード例 #10
0
        def predicate():
            try:
                self.get_token_validate(token)
                is_revoked = True

            except exceptions.NotFound:
                is_revoked = False

            return expect_that(is_revoked, equal_to(must_revoked))
コード例 #11
0
ファイル: instances.py プロジェクト: hayderimran7/stepler
            def check_rows():
                for row in page_instances.table_instances.rows:
                    if not (row.is_present
                            and query in row.link_instance.value):
                        is_present = False
                        break
                is_present = True

                return expect_that(is_present, equal_to(True))
コード例 #12
0
ファイル: v2.py プロジェクト: hayderimran7/stepler
        def _check_image_bind_status():
            members = self._client.image_members.list(image.id)
            member_ids = [member['member_id'] for member in members]
            if must_bound:
                assert_that(project.id, is_in(member_ids))
                is_bound = True
            else:
                is_bound = False

            return expect_that(is_bound, equal_to(must_bound))
コード例 #13
0
ファイル: chassis.py プロジェクト: hayderimran7/stepler
        def _check_chassis_presence():
            actual_presence = {}

            for chassis in chassis_list:
                try:
                    self._client.get(chassis.uuid)
                    actual_presence[chassis.uuid] = True
                except exceptions.NotFound:
                    actual_presence[chassis.uuid] = False

            return expect_that(actual_presence, equal_to(expected_presence))
コード例 #14
0
        def _check_ironic_nodes_presence():
            actual_presence = {}

            for node in nodes:
                try:
                    self._client.node.get(node.uuid)
                    actual_presence[node.uuid] = True
                except exceptions.NotFound:
                    actual_presence[node.uuid] = False

            return expect_that(actual_presence, equal_to(expected_presence))
コード例 #15
0
ファイル: keypairs.py プロジェクト: hayderimran7/stepler
        def _check_keypairs_presence():
            actual_presence = {}
            for keypair in keypairs:

                try:
                    keypair.get()
                    actual_presence[keypair.id] = True

                except nova_exceptions.NotFound:
                    actual_presence[keypair.id] = False

            return expect_that(actual_presence, equal_to(expected_presence))
コード例 #16
0
        def _check_role_grant_status():
            try:
                self._client.check(role,
                                   user=user,
                                   group=group,
                                   domain=domain,
                                   project=project)
                is_granted = True
            except exceptions.NotFound:
                is_granted = False

            return expect_that(is_granted, equal_to(must_granted))
コード例 #17
0
        def _is_rc_file_downloaded():
            try:
                if (os.path.basename(self._rc_path)
                        in os.listdir(self.app.download_dir)):

                    with open(self._rc_path) as f:
                        is_downloaded = bool(f.read(1))
                else:
                    is_downloaded = True
            except IOError:
                is_downloaded = False

            return expect_that(is_downloaded, equal_to(True))
コード例 #18
0
 def _check_service_state():
     matcher = has_items(*nodes)
     if not must_run:
         matcher = is_not(matcher)
     return expect_that(service.get_nodes(), matcher)
コード例 #19
0
 def predicate():
     server.get()
     return expect_that(server.metadata, matcher)
コード例 #20
0
 def _check_server_status():
     server.get()
     return expect_that(server.status.lower(),
                        is_not(is_in(transit_statuses)))
コード例 #21
0
ファイル: routers.py プロジェクト: hayderimran7/stepler
 def _check_router_presence():
     is_present = bool(self._client.find_all(id=router['id']))
     return expect_that(is_present, equal_to(must_present))
コード例 #22
0
ファイル: routers.py プロジェクト: hayderimran7/stepler
 def _check_interface_subnet_presence():
     subnet_ids = self._client.get_interfaces_subnets_ids(router['id'])
     is_present = subnet['id'] in subnet_ids
     return expect_that(is_present, equal_to(must_present))
コード例 #23
0
ファイル: routers.py プロジェクト: hayderimran7/stepler
 def _check_gateway_presence():
     router = self._client.get(router_id)
     is_present = router['external_gateway_info'] is not None
     return expect_that(is_present, equal_to(must_present))
コード例 #24
0
 def _check_snapshot_status():
     snapshot.get()
     return expect_that(snapshot.status.lower(),
                        equal_to(status.lower()))
コード例 #25
0
 def _check_fixed_ip_attached():
     server.get()
     ips_after_attach = self.get_ips(server, 'fixed').keys()
     return expect_that(len(ips_after_attach),
                        equal_to(len(ips_before_attach) + 1))
コード例 #26
0
 def _check_detach_fixed_ip():
     server.get()
     fixed_ips = self.get_ips(server, 'fixed').keys()
     return expect_that(fixed_ip, is_not(is_in(fixed_ips)))
コード例 #27
0
ファイル: backups.py プロジェクト: hayderimran7/stepler
 def _check_backup_status():
     backup.get()
     return expect_that(backup.status.lower(), equal_to(status.lower()))
コード例 #28
0
ファイル: v2.py プロジェクト: hayderimran7/stepler
 def _check_image_status():
     image.update(self._client.images.get(image.id))
     return expect_that(image.status.lower(), equal_to(status.lower()))
コード例 #29
0
 def _check_ironic_node_maintenance():
     self._get_node(node)
     return expect_that(node.maintenance, equal_to(state))
コード例 #30
0
 def _check_network_presence():
     is_present = bool(self._client.find_all(id=network['id']))
     return expect_that(is_present, equal_to(must_present))