Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
File Transfer Service
scripts
Commits
17a80779
Commit
17a80779
authored
6 months ago
by
Mihai Patrascoiu
Browse files
Options
Downloads
Patches
Plain Diff
Enable INFO and DEBUG logs for tape-rest-api tests
parent
460e0075
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tape-rest-api/libs/config.py
+6
-0
6 additions, 0 deletions
tape-rest-api/libs/config.py
tape-rest-api/libs/gfal_helper.py
+4
-1
4 additions, 1 deletion
tape-rest-api/libs/gfal_helper.py
tape-rest-api/test_case_base.py
+9
-1
9 additions, 1 deletion
tape-rest-api/test_case_base.py
with
19 additions
and
2 deletions
tape-rest-api/libs/config.py
+
6
−
0
View file @
17a80779
...
...
@@ -9,3 +9,9 @@ BulkSize = 10
# Max Polling interval in seconds
MaxPollInterval
=
10
# Enable/disable verbose printing (log level = INFO)
Verbose
=
True
# Enable/disable debug printing (log level = DEBUG)
Debug
=
False
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tape-rest-api/libs/gfal_helper.py
+
4
−
1
View file @
17a80779
...
...
@@ -9,8 +9,11 @@ def generate_random_url(root, filename):
class
GfalWrapper
:
def
__init__
(
self
):
def
__init__
(
self
,
verbose
=
False
,
debug
=
False
):
self
.
context
=
gfal2
.
creat_context
()
if
verbose
or
debug
:
gfal2_log_level
=
gfal2
.
verbose_level
.
debug
if
debug
else
gfal2
.
verbose_level
.
verbose
gfal2
.
set_verbose
(
gfal2_log_level
)
def
copy_file
(
self
,
source
,
destination
,
timeout
,
overwrite
=
False
):
params
=
self
.
context
.
transfer_parameters
()
...
...
This diff is collapsed.
Click to expand it.
tape-rest-api/test_case_base.py
+
9
−
1
View file @
17a80779
import
unittest
import
logging
from
tabnanny
import
verbose
from
libs.gfal_helper
import
*
from
libs
import
config
...
...
@@ -6,7 +9,7 @@ from libs import config
class
TestCaseBase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
handle
=
GfalWrapper
()
self
.
handle
=
GfalWrapper
(
verbose
=
config
.
Verbose
,
debug
=
config
.
Debug
)
self
.
source
=
config
.
SourceFile
self
.
root
=
config
.
TapeBaseDirectory
self
.
bulk_size
=
config
.
BulkSize
...
...
@@ -37,3 +40,8 @@ class TestCaseBase(unittest.TestCase):
def
assertAllNone
(
self
,
seq
):
for
el
in
seq
:
self
.
assertIsNone
(
el
)
if
config
.
Debug
or
config
.
Verbose
:
logging_level
=
logging
.
DEBUG
if
config
.
Debug
else
logging
.
INFO
logging
.
getLogger
().
setLevel
(
logging_level
)
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