mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-14 01:54:21 -07:00
flatpak: add tests in CI, add no_dependencies parameter (#2751)
* Similar version restrictions than flatpak_remote tests.
* ...
* Try to work around missing dependencies.
* Revert "Try to work around missing dependencies."
This reverts commit 66a4e38566
.
* Add changelog.
* App8 -> App2; make sure that there are two apps App1 and App2.
* Fix forgotten variabe.
* Remove test notices.
* Seems like flatpak no longer supports file:// URLs.
The tests would need to be rewritten to offer the URL via http:// instead.
* Try local HTTP server for URL tests.
* ...
* Lint, add status check.
* Add boilerplate.
* Add 'ps aux'.
* Surrender to -f.
* Work around apparent flatpak bug.
* Fix YAML.
* Improve condition.
* Make sure test reruns behave better.
This commit is contained in:
parent
94a53adff1
commit
bb37b67166
12 changed files with 255 additions and 140 deletions
65
tests/integration/targets/flatpak/files/serve.py
Normal file
65
tests/integration/targets/flatpak/files/serve.py
Normal file
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import posixpath
|
||||
import sys
|
||||
|
||||
try:
|
||||
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
||||
from urllib.parse import unquote
|
||||
except ImportError:
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from urllib import unquote
|
||||
|
||||
|
||||
# Argument parsing
|
||||
if len(sys.argv) != 4:
|
||||
print('Syntax: {0} <bind> <port> <path>'.format(sys.argv[0]))
|
||||
sys.exit(-1)
|
||||
|
||||
HOST, PORT, PATH = sys.argv[1:4]
|
||||
PORT = int(PORT)
|
||||
|
||||
|
||||
# The HTTP request handler
|
||||
class Handler(SimpleHTTPRequestHandler):
|
||||
def translate_path(self, path):
|
||||
# Modified from Python 3.6's version of SimpleHTTPRequestHandler
|
||||
# to support using another base directory than CWD.
|
||||
|
||||
# abandon query parameters
|
||||
path = path.split('?', 1)[0]
|
||||
path = path.split('#', 1)[0]
|
||||
# Don't forget explicit trailing slash when normalizing. Issue17324
|
||||
trailing_slash = path.rstrip().endswith('/')
|
||||
try:
|
||||
path = unquote(path, errors='surrogatepass')
|
||||
except (UnicodeDecodeError, TypeError) as exc:
|
||||
path = unquote(path)
|
||||
path = posixpath.normpath(path)
|
||||
words = path.split('/')
|
||||
words = filter(None, words)
|
||||
path = PATH
|
||||
for word in words:
|
||||
if os.path.dirname(word) or word in (os.curdir, os.pardir):
|
||||
# Ignore components that are not a simple file/directory name
|
||||
continue
|
||||
path = os.path.join(path, word)
|
||||
if trailing_slash:
|
||||
path += '/'
|
||||
return path
|
||||
|
||||
|
||||
# Run simple HTTP server
|
||||
httpd = HTTPServer((HOST, PORT), Handler)
|
||||
|
||||
try:
|
||||
httpd.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
httpd.server_close()
|
Loading…
Add table
Add a link
Reference in a new issue