コード例 #1
0
 def test_14_add_containers(self):
     '''add containers'''
     # use saved credentials; save them in the RHUI configuration first
     # first a RH container
     Helpers.set_registry_credentials(RHUA)
     RHUIManagerRepo.add_container(RHUA, self.containers["rh"]["name"], "",
                                   self.containers["rh"]["displayname"])
     # then a Quay container
     Helpers.set_registry_credentials(RHUA, "quay", backup=False)
     RHUIManagerRepo.add_container(RHUA,
                                   self.containers["alt"]["quay"]["name"])
     # and finaly a Docker container; we'll need the Docker Hub URL as there's no
     # auth config for it
     url = Helpers.get_registry_url("docker")
     Helpers.set_registry_credentials(RHUA, "docker", [url], backup=False)
     RHUIManagerRepo.add_container(RHUA,
                                   self.containers["alt"]["docker"]["name"])
     # check all of that
     repo_list = RHUIManagerRepo.list(RHUA)
     nose.tools.ok_(
         len(repo_list) == 3,
         msg="The containers weren't added. Actual repolist: %s" %
         repo_list)
コード例 #2
0
 def test_04_add_containers(self):
     '''
        add containers
     '''
     # first, add a container from RH
     # get credentials and enter them when prompted
     credentials = Helpers.get_credentials(RHUA)
     RHUIManagerRepo.add_container(RHUA, self.container_name,
                                   self.container_id,
                                   self.container_displayname,
                                   [""] + credentials)
     # second, add a container from Quay
     # get Quay credentials
     credentials = Helpers.get_credentials(RHUA, "quay")
     quay_url = Helpers.get_registry_url("quay")
     RHUIManagerRepo.add_container(RHUA,
                                   self.container_quay["name"],
                                   credentials=[quay_url] + credentials)
     # third, add a container from the Docker hub
     docker_url = Helpers.get_registry_url("docker")
     RHUIManagerRepo.add_container(RHUA,
                                   self.container_docker["name"],
                                   credentials=[docker_url])