def test_original_deployments_persisted(self): auth.reset_auth_token() auth.get_auth_token() # wait for 10 devices to be available devices = adm.get_devices_status("accepted", 10) provisioned_devices = eval(self.provisioned_devices) # check that devices and provisioned_devices are the same assert len(devices) == provisioned_devices # not sure what else I can do here, the device admission changed from 1.0 to master assert deploy.get_statistics(self.provisioned_deployment_id)["success"] == 7 assert deploy.get_statistics(self.provisioned_deployment_id)["failure"] == 3 # check failures still contain logs for device_deployment in deploy.get_deployment_overview(self.provisioned_deployment_id): if device_deployment["status"] == "failure": assert "damn" in deploy.get_logs(device_deployment["id"], self.provisioned_deployment_id) deployments_in_progress = deploy.get_status("inprogress") deployments_pending = deploy.get_status("pending") deployments_finished = deploy.get_status("finished") assert len(deployments_in_progress) == 0 assert len(deployments_pending) == 0 assert len(deployments_finished) == 1 assert self.provisioned_artifact_id in str(deployments_finished)
fill_production_template() # start docker-compose ret = subprocess.call(["docker-compose", "-p", "testprod", "-f", "docker-compose.yml", "-f", "docker-compose.storage.minio.yml", "-f", "./production-testing-env.yml", "up", "-d"], cwd="../") assert ret == 0, "failed to start docker-compose" if args.deploy: # create account for management api auth.get_auth_token() # wait for 10 devices to be available devices = adm.get_devices(10) assert len(devices) == 10 # accept all devices for d in devices: adm.set_device_status(d["id"], "accepted") # make sure artifact tool in current workdir is being used os.environ["PATH"] = os.path.dirname(os.path.realpath(__file__)) + "/downloaded-tools" + os.pathsep + os.environ["PATH"] # perform upgrade devices_to_update = list(set([device["device_id"] for device in adm.get_devices_status("accepted", expected_devices=10)])) deployment_id, artifact_id = common_update_procedure("core-image-full-cmdline-vexpress-qemu.ext4", device_type="test", devices=devices_to_update)