testRoutineSimulator.py
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# OBSOLETE FILE
# from django.conf import settings
# from django.test import TestCase
# from common.models import *
# from time import gmtime, strftime
#
# import os
# import sys
# import time
# import datetime
# import logger.config as l
#
#
# """ logger """
# log = l.setupLogger("testRoutine", "testRoutine")
#
# class SimulatorRoutine(TestCase):
#
# fixtures = ["initial_fixture.json"]
#
# def setUp(self):
# pass
#
# def createRoutine(self, users, requests, quantity, delay):
# count = 0
# while (count < quantity):
# date = str(datetime.datetime.now())
# req = Request(name="Simulation %d"%count,
# desc="Request of routin simulation",
# created=date,
# updated=date,
# is_alert=0,
# target_type="test",
# status=None,
# autodeposit=0,
# checkpoint=None,
# flag=None,
# complete=0,
# pyros_user_id=1,
# scientific_program_id=1)
#
# def test_creation(self):
# # Launching the web server on test database
# print("Launching Web server on test database (ONLY MYSQL FOR NOW)")
# os.system("%s/../pyrosrun.sh test_runserver &"%(settings.BASE_DIR))
# # Waiting for the server to be launched
# time.sleep(10)
#
# # Kill the process linked to port defined in test_settings.py
# print("Killing Web server on port %d"%(settings.TEST_PORT))
# os.system("fuser -k %d/tcp"%(settings.TEST_PORT))
# print("Simulation ended")