Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
mediaserver
envsetup
Commits
26aca704
Commit
26aca704
authored
7 years ago
by
Florent Thiery
Browse files
Options
Downloads
Patches
Plain Diff
only try to descend into folders, refs
#21677
parent
5ebb14b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_backup.py
+17
-15
17 additions, 15 deletions
tests/test_backup.py
with
17 additions
and
15 deletions
tests/test_backup.py
+
17
−
15
View file @
26aca704
...
@@ -70,22 +70,24 @@ def test_backup_space(server):
...
@@ -70,22 +70,24 @@ def test_backup_space(server):
def
check_local_backup
(
path
):
def
check_local_backup
(
path
):
all_ok
=
True
all_ok
=
True
for
d
in
os
.
listdir
(
path
):
for
d
in
os
.
listdir
(
path
):
subd
=
os
.
path
.
join
(
path
,
d
)
if
os
.
path
.
isdir
(
d
):
latest
=
os
.
path
.
join
(
subd
,
'
latest
'
)
subd
=
os
.
path
.
join
(
path
,
d
)
if
os
.
path
.
exists
(
latest
):
latest
=
os
.
path
.
join
(
subd
,
'
latest
'
)
mtime
=
os
.
path
.
getmtime
(
latest
)
if
os
.
path
.
exists
(
latest
):
d
=
datetime
.
fromtimestamp
(
mtime
)
mtime
=
os
.
path
.
getmtime
(
latest
)
now
=
datetime
.
now
()
d
=
datetime
.
fromtimestamp
(
mtime
)
diff_seconds
=
(
now
-
d
).
total_seconds
()
now
=
datetime
.
now
()
if
diff_seconds
>
25
*
3600
:
diff_seconds
=
(
now
-
d
).
total_seconds
()
print
(
'
Backup %s is older than a day
'
%
subd
)
if
diff_seconds
>
25
*
3600
:
all_ok
=
False
print
(
'
Backup %s is older than a day
'
%
subd
)
all_ok
=
False
else
:
print
(
'
Backup %s is fine
'
%
subd
)
else
:
else
:
print
(
'
Backup %s is fine
'
%
subd
)
for
dd
in
os
.
listdir
(
subd
):
else
:
if
os
.
path
.
isdir
(
dd
):
for
dd
in
os
.
listdir
(
subd
):
subsubd
=
os
.
path
.
join
(
subd
,
dd
)
subsubd
=
os
.
path
.
join
(
subd
,
dd
)
all_ok
=
min
(
all_ok
,
check_local_backup
(
subsubd
))
all_ok
=
min
(
all_ok
,
check_local_backup
(
subsubd
))
return
all_ok
return
all_ok
...
...
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