mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Run service test on py3 + unprivileged on docker. (#19841)
* Run service test on py3 + unprivileged on docker. * Fix service integration test for python 3.
This commit is contained in:
parent
a1d30c853c
commit
709a3aa42b
3 changed files with 3 additions and 6 deletions
|
@ -1,6 +1,4 @@
|
||||||
destructive
|
destructive
|
||||||
needs/privileged
|
|
||||||
posix/ci/group1
|
posix/ci/group1
|
||||||
skip/freebsd
|
skip/freebsd
|
||||||
skip/osx
|
skip/osx
|
||||||
skip/python3
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ def createDaemon():
|
||||||
try:
|
try:
|
||||||
pid = os.fork()
|
pid = os.fork()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise Exception, "%s [%d]" % (e.strerror, e.errno)
|
raise Exception("%s [%d]" % (e.strerror, e.errno))
|
||||||
|
|
||||||
if (pid == 0):
|
if (pid == 0):
|
||||||
os.setsid()
|
os.setsid()
|
||||||
|
@ -29,7 +29,7 @@ def createDaemon():
|
||||||
try:
|
try:
|
||||||
pid = os.fork()
|
pid = os.fork()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise Exception, "%s [%d]" % (e.strerror, e.errno)
|
raise Exception("%s [%d]" % (e.strerror, e.errno))
|
||||||
|
|
||||||
if (pid == 0):
|
if (pid == 0):
|
||||||
os.chdir(WORKDIR)
|
os.chdir(WORKDIR)
|
||||||
|
@ -45,7 +45,7 @@ def createDaemon():
|
||||||
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
|
||||||
if (maxfd == resource.RLIM_INFINITY):
|
if (maxfd == resource.RLIM_INFINITY):
|
||||||
maxfd = MAXFD
|
maxfd = MAXFD
|
||||||
|
|
||||||
for fd in range(0, maxfd):
|
for fd in range(0, maxfd):
|
||||||
try:
|
try:
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "install_result.dest == '/usr/sbin/ansible_test_service'"
|
- "install_result.dest == '/usr/sbin/ansible_test_service'"
|
||||||
- "install_result.checksum == '4e0164ceb9a5aeab76b38483ffd27fe791baa9f4'"
|
|
||||||
- "install_result.state == 'file'"
|
- "install_result.state == 'file'"
|
||||||
- "install_result.mode == '0755'"
|
- "install_result.mode == '0755'"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue