Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
362d4ab2
Commit
362d4ab2
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-287
: instantiate the RATestEnvironment as well, so we can actually schedule stuff
parent
edeb41bc
No related branches found
No related tags found
1 merge request
!188
TMSS-287: implemented CycleQuota
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/test/test_utils.py
+28
-25
28 additions, 25 deletions
SAS/TMSS/test/test_utils.py
with
28 additions
and
25 deletions
SAS/TMSS/test/test_utils.py
+
28
−
25
View file @
362d4ab2
...
@@ -35,6 +35,8 @@ from lofar.sas.tmss.tmss.exceptions import TMSSException
...
@@ -35,6 +35,8 @@ from lofar.sas.tmss.tmss.exceptions import TMSSException
from
lofar.messaging.config
import
DEFAULT_BROKER
,
DEFAULT_BUSNAME
from
lofar.messaging.config
import
DEFAULT_BROKER
,
DEFAULT_BUSNAME
from
lofar.common.testing.dbcredentials
import
TemporaryCredentials
from
lofar.common.testing.dbcredentials
import
TemporaryCredentials
from
lofar.sas.tmss.client.tmss_http_rest_client
import
TMSSsession
from
lofar.sas.tmss.client.tmss_http_rest_client
import
TMSSsession
from
lofar.sas.resourceassignment.resourceassigner.test.ra_test_environment
import
RATestEnvironment
def
assertDataWithUrls
(
self
,
data
,
expected
):
def
assertDataWithUrls
(
self
,
data
,
expected
):
"""
"""
...
@@ -346,32 +348,33 @@ def main_test_environment():
...
@@ -346,32 +348,33 @@ def main_test_environment():
parser
.
add_option_group
(
group
)
parser
.
add_option_group
(
group
)
(
options
,
args
)
=
parser
.
parse_args
()
(
options
,
args
)
=
parser
.
parse_args
()
#
logging.basicConfig(format = '%(asctime)s %(levelname)s %(message)s', level = logging.INFO)
logging
.
basicConfig
(
format
=
'
%(asctime)s %(levelname)s %(message)s
'
,
level
=
logging
.
INFO
)
with
TMSSTestEnvironment
(
host
=
options
.
host
,
preferred_django_port
=
options
.
port
,
exchange
=
options
.
exchange
,
broker
=
options
.
broker
)
as
instance
:
with
RATestEnvironment
(
exchange
=
options
.
exchange
,
broker
=
options
.
broker
):
# print some nice info for the user to use the test servers...
with
TMSSTestEnvironment
(
host
=
options
.
host
,
preferred_django_port
=
options
.
port
,
exchange
=
options
.
exchange
,
broker
=
options
.
broker
)
as
instance
:
# use print instead of log for clean lines.
# print some nice info for the user to use the test servers...
for
h
in
logging
.
root
.
handlers
:
# use print instead of log for clean lines.
h
.
flush
()
for
h
in
logging
.
root
.
handlers
:
print
()
h
.
flush
()
print
()
print
()
print
(
"
*****************************************************
"
)
print
()
print
(
"
Test-TMSS database, LDAP and Django up and running...
"
)
print
(
"
*****************************************************
"
)
print
(
"
*****************************************************
"
)
print
(
"
Test-TMSS database, LDAP and Django up and running...
"
)
print
(
"
DB Credentials ID: %s
"
%
(
instance
.
database
.
dbcreds_id
,
))
print
(
"
*****************************************************
"
)
print
(
"
LDAP Credentials ID: %s
"
%
(
instance
.
django_server
.
ldap_dbcreds_id
,
))
print
(
"
DB Credentials ID: %s
"
%
(
instance
.
database
.
dbcreds_id
,
))
print
(
"
TMSS Client Credentials ID: %s
"
%
(
instance
.
client_credentials
.
dbcreds_id
,
))
print
(
"
LDAP Credentials ID: %s
"
%
(
instance
.
django_server
.
ldap_dbcreds_id
,
))
print
(
"
Django URL: %s
"
%
(
instance
.
django_server
.
url
))
print
(
"
TMSS Client Credentials ID: %s
"
%
(
instance
.
client_credentials
.
dbcreds_id
,
))
print
()
print
(
"
Django URL: %s
"
%
(
instance
.
django_server
.
url
))
print
(
"
Example cmdlines to run tmss or tmss_manage_django:
"
)
print
()
print
(
"
TMSS_DBCREDENTIALS=%s TMSS_LDAPCREDENTIALS=%s tmss
"
%
(
instance
.
database
.
dbcreds_id
,
instance
.
django_server
.
ldap_dbcreds_id
))
print
(
"
Example cmdlines to run tmss or tmss_manage_django:
"
)
print
(
"
TMSS_DBCREDENTIALS=%s TMSS_LDAPCREDENTIALS=%s tmss_manage_django
"
%
(
instance
.
database
.
dbcreds_id
,
instance
.
django_server
.
ldap_dbcreds_id
))
print
(
"
TMSS_DBCREDENTIALS=%s TMSS_LDAPCREDENTIALS=%s tmss
"
%
(
instance
.
database
.
dbcreds_id
,
instance
.
django_server
.
ldap_dbcreds_id
))
print
()
print
(
"
TMSS_DBCREDENTIALS=%s TMSS_LDAPCREDENTIALS=%s tmss_manage_django
"
%
(
instance
.
database
.
dbcreds_id
,
instance
.
django_server
.
ldap_dbcreds_id
))
print
(
"
Example cmdline to run tmss client call:
"
)
print
()
print
(
"
TMSS_CLIENT_DBCREDENTIALS=%s tmss_set_subtask_state <id> <state>
"
%
(
instance
.
client_credentials
.
dbcreds_id
,
))
print
(
"
Example cmdline to run tmss client call:
"
)
print
()
print
(
"
TMSS_CLIENT_DBCREDENTIALS=%s tmss_set_subtask_state <id> <state>
"
%
(
instance
.
client_credentials
.
dbcreds_id
,
))
print
(
"
Press Ctrl-C to exit (and remove the test database and django server automatically)
"
)
print
()
waitForInterrupt
()
print
(
"
Press Ctrl-C to exit (and remove the test database and django server automatically)
"
)
waitForInterrupt
()
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment