Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LHCbDIRAC
Manage
Activity
Members
Labels
Plan
Issues
16
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
11
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
LHCb Dirac
LHCbDIRAC
Merge requests
!17
Integration test for ResourceManagement -
LHCBDIRAC-491
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Integration test for ResourceManagement -
LHCBDIRAC-491
smiras/LHCbDIRAC:Integration_Tests2
into
devel
Overview
0
Commits
1
Pipelines
0
Changes
Closed
Stavros Moiras
requested to merge
smiras/LHCbDIRAC:Integration_Tests2
into
devel
8 years ago
Overview
0
Commits
1
Pipelines
0
Changes
-
Expand
Finished the extension of ResourceManagement for LHCbDirac
👍
0
👎
0
Merge request reports
Compare
devel
devel (base)
and
latest version
latest version
61101678
1 commit,
8 years ago
+
123
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
Search (e.g. *.vue) (Ctrl+P)
tests/Integration/ResourceStatusSystem/Test_ResourceManagement.py
0 → 100644
+
123
−
0
Options
''' This is a test of the chain
ResourceManagementClient -> ResourceManagementHandler -> ResourceManagementDB
It supposes that the DB is present, and that the service is running
this is pytest!
'''
import datetime
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()
from DIRAC import gLogger
from DIRAC.tests.Integration.ResourceStatusSystem.Test_ResourceManagement import ResourceManagementClient as ResourceManagementClientChain
from LHCbDIRAC.ResourceStatusSystem.Client.ResourceManagementClient import ResourceManagementClient
gLogger.setLevel('DEBUG')
rsClient = ResourceManagementClient()
ResourceManagementClientChain.test_addAndRemove()
Datetime = datetime.datetime.now()
def test_addAndRemove():
# TEST addOrModifyMonitoringTest
# ...............................................................................
res = rsClient.addOrModifyMonitoringTest('TestName1234', 'serviceURI', 'siteName', 'serviceFlavour',
'metricStatus', 'summaryData', Datetime, Datetime)
assert res['OK'] == True
res = rsClient.selectMonitoringTest('TestName1234')
assert res['OK'] == True
#check if the name that we got is equal to the previously added 'TestName1234'
assert res['Value'][0][7] == 'TestName1234'
# TEST deleteMonitoringTest
# ...............................................................................
res = rsClient.deleteMonitoringTest('TestName1234')
assert res['OK'] == True
res = rsClient.selectMonitoringTest('TestName1234')
assert res['OK'] == True
assert not res['Value']
# TEST addOrModifyJobAccountingCache
# ...............................................................................
res = rsClient.addOrModifyJobAccountingCache('TestName1234')
assert res['OK'] == True
res = rsClient.selectJobAccountingCache('TestName1234')
assert res['OK'] == True
#check if the name that we got is equal to the previously added 'TestName1234'
assert res['Value'][0][3] == 'TestName1234'
# TEST deleteJobAccountingCache
# ...............................................................................
res = rsClient.deleteJobAccountingCache('TestName1234')
assert res['OK'] == True
res = rsClient.selectJobAccountingCache('TestName1234')
assert res['OK'] == True
assert not res['Value']
# TEST addOrModifyPilotAccountingCache
# ...............................................................................
res = rsClient.addOrModifyPilotAccountingCache('TestName1234')
assert res['OK'] == True
res = rsClient.selectPilotAccountingCache('TestName1234')
assert res['OK'] == True
#check if the name that we got is equal to the previously added 'TestName1234'
assert res['Value'][0][0] == 'TestName1234'
# TEST deletePilotAccountingCache
# ...............................................................................
res = rsClient.deletePilotAccountingCache('TestName1234')
assert res['OK'] == True
res = rsClient.selectPilotAccountingCache('TestName1234')
assert res['OK'] == True
assert not res['Value']
# TEST addOrModifyEnvironmentCache
# ...............................................................................
res = rsClient.addOrModifyEnvironmentCache('TestName1234', 'environment', 'siteName',
'arguments', Datetime, Datetime)
assert res['OK'] == True
res = rsClient.selectEnvironmentCache('TestName1234')
assert res['OK'] == True
#check if the name that we got is equal to the previously added 'TestName1234'
assert res['Value'][0][4] == 'TestName1234'
# TEST deleteEnvironmentCache
# ...............................................................................
res = rsClient.deleteEnvironmentCache('TestName1234')
assert res['OK'] == True
res = rsClient.selectEnvironmentCache('TestName1234')
assert res['OK'] == True
assert not res['Value']
# EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF#EOF
Loading