From 709a3aa42b829b13f4d58d9c0d4748d46be826b4 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 4 Jan 2017 15:55:57 -0800 Subject: [PATCH] Run service test on py3 + unprivileged on docker. (#19841) * Run service test on py3 + unprivileged on docker. * Fix service integration test for python 3. --- test/integration/targets/service/aliases | 2 -- test/integration/targets/service/files/ansible_test_service | 6 +++--- test/integration/targets/service/tasks/main.yml | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/integration/targets/service/aliases b/test/integration/targets/service/aliases index b46d4eb449e..5d97a9be5ee 100644 --- a/test/integration/targets/service/aliases +++ b/test/integration/targets/service/aliases @@ -1,6 +1,4 @@ destructive -needs/privileged posix/ci/group1 skip/freebsd skip/osx -skip/python3 diff --git a/test/integration/targets/service/files/ansible_test_service b/test/integration/targets/service/files/ansible_test_service index 5e8691f2f10..682edebb85b 100755 --- a/test/integration/targets/service/files/ansible_test_service +++ b/test/integration/targets/service/files/ansible_test_service @@ -21,7 +21,7 @@ def createDaemon(): try: pid = os.fork() except OSError as e: - raise Exception, "%s [%d]" % (e.strerror, e.errno) + raise Exception("%s [%d]" % (e.strerror, e.errno)) if (pid == 0): os.setsid() @@ -29,7 +29,7 @@ def createDaemon(): try: pid = os.fork() except OSError as e: - raise Exception, "%s [%d]" % (e.strerror, e.errno) + raise Exception("%s [%d]" % (e.strerror, e.errno)) if (pid == 0): os.chdir(WORKDIR) @@ -45,7 +45,7 @@ def createDaemon(): maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] if (maxfd == resource.RLIM_INFINITY): maxfd = MAXFD - + for fd in range(0, maxfd): try: os.close(fd) diff --git a/test/integration/targets/service/tasks/main.yml b/test/integration/targets/service/tasks/main.yml index e11702c4df6..368c201dad3 100644 --- a/test/integration/targets/service/tasks/main.yml +++ b/test/integration/targets/service/tasks/main.yml @@ -6,7 +6,6 @@ assert: that: - "install_result.dest == '/usr/sbin/ansible_test_service'" - - "install_result.checksum == '4e0164ceb9a5aeab76b38483ffd27fe791baa9f4'" - "install_result.state == 'file'" - "install_result.mode == '0755'"