def test_two_multiple_uses_of_different_devices(self):
        user1_session_id = self.client.login('intstudent1','password')

        user1_experiments = self.client.list_experiments(user1_session_id)
        self.assertEquals( 2, len(user1_experiments))

        dummy1_experiments = [ exp.experiment for exp in user1_experiments if exp.experiment.name == 'dummy1' ]
        self.assertEquals( len(dummy1_experiments), 1)

        # reserve it
        status = self.client.reserve_experiment( user1_session_id, dummy1_experiments[0].to_experiment_id(), "{}", "{}")
        user1_reservation_id = status.reservation_id


        user2_session_id = self.client.login('intstudent2','password')

        user2_experiments = self.client.list_experiments(user2_session_id)
        self.assertEquals( 2, len(user2_experiments))

        dummy2_experiments = [ exp.experiment for exp in user2_experiments if exp.experiment.name == 'dummy2' ]
        self.assertEquals( len(dummy2_experiments), 1)

        # reserve it
        status = self.client.reserve_experiment(user2_session_id, dummy2_experiments[0].to_experiment_id(), "{}", "{}")
        user2_reservation_id = status.reservation_id



        short_time = 0.1
        times      = 9.0 / short_time

        while times > 0:
            time.sleep(short_time)

            new_status1 = self.client.get_reservation_status(user1_reservation_id)

            new_status2 = self.client.get_reservation_status(user2_reservation_id)

            if not isinstance(new_status1, Reservation.WaitingConfirmationReservation):
                if not isinstance(new_status2, Reservation.WaitingConfirmationReservation):
                    break
            times -= 1

        self.assertTrue(isinstance(self.client.get_reservation_status(user1_reservation_id), Reservation.ConfirmedReservation))
        self.assertTrue(isinstance(self.client.get_reservation_status(user2_reservation_id), Reservation.ConfirmedReservation))

        # send a program
        CONTENT1 = "content of the program DUMMY1"
        response = self.client.send_file(user1_reservation_id, ExperimentUtil.serialize(CONTENT1), 'program')
        self.assertEquals('ack', response.commandstring)

        # We need to wait for the programming to finish.
        respcmd = self.client.send_command(user1_reservation_id, Command.Command("STATE DUMMY1"))
        response = respcmd.get_command_string()

        # Check that the current state is "Ready"
        self.assertEquals("STATE DUMMY1", response)

        CONTENT2 = "content of the program PLD"
        response = self.client.send_file(user2_reservation_id, ExperimentUtil.serialize(CONTENT2), 'program')
        self.assertEquals('ack', response.commandstring)

        # We need to wait for the programming to finish.
        respcmd = self.client.send_command(user2_reservation_id, Command.Command("STATE DUMMY2"))
        # Check that the current state is "Ready"
        self.assertEquals("STATE DUMMY2", respcmd.commandstring)

        # end session
        self.client.logout(user1_session_id)
        self.client.logout(user2_session_id)
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/test/integration/general/test_no_concurrency.py/IntegrationNoConcurrencyTestCase.test_two_multiple_uses_of_different_devices/original