Exemple #1
0
    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)
Exemple #2
0
    def test_deployments_post_upgrade(self):
        adm.get_devices_status("accepted", 10)

        # 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-%s.ext4" % conftest.machine_name,
                                                             device_type="test",
                                                             devices=devices_to_update)

        deploy.check_expected_status("finished", deployment_id)
        assert deploy.get_statistics(deployment_id)["success"] == 7
        assert deploy.get_statistics(deployment_id)["failure"] == 3

        deploy.get_status("finished")