Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
padmwsverify
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stw
wt
padmwsverify
Commits
b6e4ed15
Commit
b6e4ed15
authored
Feb 14, 2017
by
Tomas Pettersson
🏸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made runs random and added statistics
parent
a720e5a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
.gitignore
.gitignore
+3
-1
build/SMHI-padmwsverify.spec
build/SMHI-padmwsverify.spec
+4
-4
run/run.py
run/run.py
+15
-6
No files found.
.gitignore
View file @
b6e4ed15
run.cfg
\ No newline at end of file
run.cfg
statistics.txt
run.txt
\ No newline at end of file
build/SMHI-padmwsverify.spec
View file @
b6e4ed15
...
...
@@ -45,10 +45,10 @@ if [ $1 -gt 1 ]; then
/usr/bin/systemctl stop %{name}.timer
# Sleep just to be on the safe side
sleep 10
# Remove all but the
logs
directory
find /local_disk/%{name}
-mindepth 1 -maxdepth 1 -depth -not -name logs
-print0 | xargs -0 rm -rf
# Remove all log files older than
1
0 days
find /local_disk/%{name}/
logs -type f -mtime +1
0 -print0 | xargs -0 rm -rf
# Remove all but the
run output
directory
find /local_disk/%{name}
/run -mindepth 1 -maxdepth 1 -depth -not -name output
-print0 | xargs -0 rm -rf
# Remove all log files older than
3
0 days
find /local_disk/%{name}/
run/output -type f -mtime +3
0 -print0 | xargs -0 rm -rf
fi
...
...
run/run.py
View file @
b6e4ed15
...
...
@@ -4,6 +4,7 @@
import
sys
import
json
import
requests
import
random
from
requests.auth
import
HTTPBasicAuth
from
time
import
time
,
strftime
,
sleep
from
datetime
import
datetime
,
timedelta
...
...
@@ -48,13 +49,15 @@ class Runner(object):
end
=
time
()
# done
hasError
=
requests
.
get
(
'/'
.
join
([
self
.
url
,
"workarea"
,
"v2"
,
wid
,
"error.txt"
])).
status_code
==
200
with
open
(
path
+
'/output/
'
+
name
+
'
.txt'
,
'w'
)
as
outputfile
:
with
open
(
path
+
'/output/
run
.txt'
,
'w'
)
as
outputfile
:
if
(
status
!=
'COMPLETE'
)
or
hasError
:
outputfile
.
write
(
'0'
)
with
open
(
path
+
'/output/'
+
name
+
'_'
+
datetime
.
utcnow
().
strftime
(
"%Y%m%d%H%M"
)
+
'.txt'
,
'w'
)
as
errorfile
:
errorfile
.
write
(
wid
)
else
:
outputfile
.
write
(
'1'
)
with
open
(
path
+
'/output/statistics.txt'
,
'a'
)
as
statisticsfile
:
statisticsfile
.
write
(
datetime
.
utcnow
().
strftime
(
"%Y%m%d%H%M"
)
+
' '
+
wid
+
' '
+
name
+
'
\n
'
)
class
HELCOM_NEMO
(
Runner
):
def
__init__
(
self
,
value
):
...
...
@@ -84,13 +87,19 @@ class VN_NEMO(Runner):
super
(
VN_NEMO
,
self
).
__call__
(
self
.
jdata
,
self
.
name
,
"VN_NEMO"
)
# TODO
# Change user to stw when ready
# Create packages to be able to run tests in separate files
# Install in prod
# Create Ester for monitor signal
def
main
():
start
=
time
()
try
:
for
v
in
[
HELCOM_NEMO
(
1
),
HELCOM_NEMO
(
2
),
VN_NEMO
(
1
),
BF_NEMO
(
1
)]:
v
()
end
=
time
()
print
"All done in "
+
str
(
end
-
start
)
+
" seconds"
v
=
[
HELCOM_NEMO
(
1
),
HELCOM_NEMO
(
2
),
VN_NEMO
(
1
),
BF_NEMO
(
1
)]
r
=
random
.
choice
(
v
)
r
();
sys
.
exit
(
0
)
except
Exception
as
error
:
print
error
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment