Skip to content

Commit

Permalink
[test] use shell=True to launch python3 http server
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Apr 20, 2024
1 parent e51bb2d commit 0fb96d4
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/sanity/additional_trust_anchors/test.py
Expand Up @@ -18,7 +18,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'https-server.py', port])
server = subprocess.Popen(['python3', 'https-server.py', port], shell=True)

def read_ca_cert():
return read_and_replace_file('ca.crt', '\n', '')
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/app-open-event/test.py
Expand Up @@ -18,7 +18,7 @@
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options, service_log_path="log", service_args=["--verbose"])
try:
print((driver.current_url))
second_instance = subprocess.Popen(['python3', 'second_instance.py'])
second_instance = subprocess.Popen(['python3', 'second_instance.py'], shell=True)
result = wait_for_element_id_content(driver, 'result', 'success')
print(result)
finally:
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/iframe-remote-neg/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

html = open('index.html', 'w')
html.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/iframe-remote/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

html = open('index.html', 'w')
html.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4096-download/test.py
Expand Up @@ -19,7 +19,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

html = open('index.html', 'w')
html.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4130-win-open-close-fail-http/test.py
Expand Up @@ -17,7 +17,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4143-chrome-sockets-permission/test.py
Expand Up @@ -14,7 +14,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4180-remote-win-open/test.py
Expand Up @@ -14,7 +14,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4184-no-opener/test.py
Expand Up @@ -17,7 +17,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'https-server.py', port])
server = subprocess.Popen(['python3', 'https-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4269-click-link-crash/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('inspect.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue4788-openremote-cdtopen/test.py
Expand Up @@ -19,7 +19,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

html = open('index.html', 'w')
html.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue5781-X-Frame-Options/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue6099-AdSense-trouble/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/issue7305-nwfaketop-cookie-neg/test.py
Expand Up @@ -21,7 +21,7 @@
pass

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'https-server.py', port])
server = subprocess.Popen(['python3', 'https-server.py', port], shell=True)

tpl = open('index.tpl', 'r')
content = tpl.read().replace('{port}', port)
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/node-remote-array/test.py
Expand Up @@ -14,7 +14,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

manifest = open('package.json', 'w')
manifest.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/node-remote-negtive/test.py
Expand Up @@ -16,7 +16,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

manifest = open('package.json', 'w')
manifest.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/node-remote/test.py
Expand Up @@ -13,7 +13,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

manifest = open('package.json', 'w')
manifest.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/open-remote/test.py
Expand Up @@ -18,7 +18,7 @@
os.chdir(testdir)

port = str(utils.free_port())
server = subprocess.Popen(['python3', 'http-server.py', port])
server = subprocess.Popen(['python3', 'http-server.py', port], shell=True)

html = open('index.html', 'w')
html.write('''
Expand Down
2 changes: 1 addition & 1 deletion test/sanity/user-agent/test.py
Expand Up @@ -10,7 +10,7 @@
testdir = os.path.dirname(os.path.abspath(__file__))
os.chdir(testdir)

server = subprocess.Popen(['python3', '-u', 'echo-user-agent.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
server = subprocess.Popen(['python3', '-u', 'echo-user-agent.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
print(server.stdout.readline())

driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
Expand Down

0 comments on commit 0fb96d4

Please sign in to comment.