Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
b0ed0bc0
Commit
b0ed0bc0
authored
Feb 14, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend/test: Assert file existence before rewrite
parent
b50f2166
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+22
-20
No files found.
software/caddy-frontend/test/test.py
View file @
b0ed0bc0
...
@@ -2411,9 +2411,9 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
...
@@ -2411,9 +2411,9 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
open(
fname = os.path.join(self.software_path, '
bin
', '
is
-
icmp
-
packet
-
lost
')
os.path.join(self.software_path, '
bin
', '
is
-
icmp
-
packet
-
lost
'), '
w
'
self.assertTrue(os.path.isfile(fname))
).write('
echo
"$@"')
open(fname, '
w
'
).write('
echo
"$@"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
@@ -2453,9 +2453,9 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
...
@@ -2453,9 +2453,9 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
open(
fname = os.path.join(self.software_path, '
bin
', '
is
-
icmp
-
packet
-
lost
')
os.path.join(self.software_path, '
bin
', '
is
-
icmp
-
packet
-
lost
'), '
w
'
self.assertTrue(os.path.isfile(fname))
).write('
echo
"$@"')
open(fname, '
w
'
).write('
echo
"$@"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
@@ -2495,10 +2495,10 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
...
@@ -2495,10 +2495,10 @@ http://apachecustomhttpsaccepted.example.com:%%(http_port)s {
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
ope
n(
fname = os.path.joi
n(
os.path.join(
self.software_path, '
bin
', '
check
-
re6st
-
optimal
-
status
')
self.software_path, '
bin
', '
check
-
re6st
-
optimal
-
status
'), '
w
'
self.assertTrue(os.path.isfile(fname))
).write('
echo
"$@"')
open(fname, '
w
'
).write('
echo
"$@"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
@@ -3836,10 +3836,10 @@ https://www.google.com {}""",
...
@@ -3836,10 +3836,10 @@ https://www.google.com {}""",
self.assertEqual(httplib.NOT_FOUND, result.status_code)
self.assertEqual(httplib.NOT_FOUND, result.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
ope
n(
fname = os.path.joi
n(
os.path.join(
self.software_path, 'bin', 'check-re6st-optimal-status')
self.software_path, 'bin', 'check-re6st-optimal-status'), 'w'
self.assertTrue(os.path.isfile(fname))
).write('echo "
$
@
"')
open(fname, 'w'
).write('echo "
$
@
"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
@@ -4030,9 +4030,10 @@ https://www.google.com {}""",
...
@@ -4030,9 +4030,10 @@ https://www.google.com {}""",
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
open(
fname = os.path.join(
os.path.join(self.software_path, 'bin', 'is-icmp-packet-lost'), 'w'
self.software_path, 'bin', 'is-icmp-packet-lost')
).write('echo "
$
@
"')
self.assertTrue(os.path.isfile(fname))
open(fname, 'w').write('echo "
$
@
"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
@@ -4072,9 +4073,10 @@ https://www.google.com {}""",
...
@@ -4072,9 +4073,10 @@ https://www.google.com {}""",
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
self.assertEqual(httplib.NOT_FOUND, result_http.status_code)
# rewrite SR/bin/is-icmp-packet-lost
# rewrite SR/bin/is-icmp-packet-lost
open(
fname = os.path.join(
os.path.join(self.software_path, 'bin', 'is-icmp-packet-lost'), 'w'
self.software_path, 'bin', 'is-icmp-packet-lost')
).write('echo "
$
@
"')
self.assertTrue(os.path.isfile(fname))
open(fname, 'w').write('echo "
$
@
"')
# call the monitor for this partition
# call the monitor for this partition
monitor_file = glob.glob(
monitor_file = glob.glob(
os.path.join(
os.path.join(
...
...
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