Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

add tests + standard test invocation #5

Merged
merged 9 commits into from
Aug 22, 2018

Conversation

TomasTomecek
Copy link
Member

@TomasTomecek TomasTomecek commented Oct 10, 2017

  • TODO: make the playbook executable on remote host (workflow: provision a VM in openstack, execute the playbook against the fresh VM -- hosts: something, not localhost)

Requirements

  1. Familairty with standard test interface:
  2. Ansible, distgen (dnf install ansible distgen)
  3. docker running
  4. Requires these changes: https://pagure.io/standard-test-roles/pull-request/121
    You can just clone those changes locally and then point ansible to look for those roles like this:
    $ tail -n 1 ./tests/ansible.cfg
    roles_path = </path/to/the/repo>/roles
    

How to test?

This will invoke the tests in your current environment:

$ make check

...

TASK [standard-test-basic : Execute tests] ********************************
changed: [localhost] => (item=integration)

TASK [standard-test-basic : Check the results] ****************************
changed: [localhost]

TASK [standard-test-basic : include_role] *********************************

TASK [str-common : Pull out the logs from test environment to test runner]
changed: [localhost]

TASK [delete the temp dir] ************************************************
changed: [localhost]

PLAY RECAP ****************************************************************
localhost                  : ok=20   changed=8    unreachable=0    failed=0

make[1]: Leaving directory '/home/tt/g/tools/tests'

No errors nor failures = successful run.

There is also possibility to invoke tests inside a freshly provisioned VM:

$ make check-in-vm

Logs from the tests are stored over here:

$ cat tests/artifacts/test.integration.log
============================= test session starts ==============================
platform linux -- Python 3.6.4, pytest-3.2.3, py-1.5.2, pluggy-0.4.0 -- /usr/bin/python3
cachedir: .cache
rootdir: /tmp/ansible.mo9bas/integration, inifile:
plugins: cov-2.5.1, catchlog-1.2.2, celery-4.0.2
collecting ... collected 8 items

test_container.py::TestContainer::test_ethtool PASSED
test_container.py::TestContainer::test_netstat PASSED
test_container.py::TestContainer::test_ss PASSED
test_container.py::TestContainer::test_pstack PASSED
test_container.py::TestContainer::test_nstat PASSED
test_container.py::TestContainer::test_numastat PASSED
test_container.py::TestContainer::test_pmap PASSED
test_container.py::TestContainer::test_strace PASSED

=========================== 8 passed in 4.33 seconds ===========================

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all tests are not passing. Please fix them.

On my notebook make check failed. Seems like conflict between dnf-utils and yum-utils.

TASK [str-common : Install dnf-utils] *****************************************************************************************************************************************************************************
 [WARNING]: Consider using dnf module rather than running dnf

fatal: [localhost]: FAILED! => {"changed": true, "cmd": "dnf --assumeyes --allowerasing install dnf-utils", "delta": "0:00:04.729403", "end": "2018-02-26 09:54:02.512056", "msg": "non-zero return code", "rc": 1, "start": "2018-02-26 09:53:57.782653", "stderr": "Failed to synchronize cache for repo 'Dropbox', disabling.\nError: Transaction check error:\n  file /usr/bin/debuginfo-install from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/find-repos-of-install from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/package-cleanup from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/repo-graph from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/repoclosure from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/repomanage from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/repoquery from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/reposync from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/repotrack from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/yum-builddep from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/yum-config-manager from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/yum-debug-dump from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/yum-debug-restore from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n  file /usr/bin/yumdownloader from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch\n\nError Summary\n-------------", "stderr_lines": ["Failed to synchronize cache for repo 'Dropbox', disabling.", "Error: Transaction check error:", "  file /usr/bin/debuginfo-install from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/find-repos-of-install from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/package-cleanup from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/repo-graph from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/repoclosure from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/repomanage from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/repoquery from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/reposync from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/repotrack from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/yum-builddep from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/yum-config-manager from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/yum-debug-dump from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/yum-debug-restore from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "  file /usr/bin/yumdownloader from install of dnf-utils-2.1.5-1.fc27.noarch conflicts with file from package yum-utils-1.1.31-513.fc27.noarch", "", "Error Summary", "-------------"], "stdout": "Last metadata expiration check: 0:34:33 ago on Mon 26 Feb 2018 09:19:26 AM CET.\nDependencies resolved.\n================================================================================\n Package                     Arch      Version           Repository        Size\n================================================================================\nInstalling:\n dnf-utils                   noarch    2.1.5-1.fc27      fedora-latest     41 k\nDowngrading:\n dnf-plugins-core            noarch    2.1.5-1.fc27      fedora-latest     51 k\n python3-dnf-plugins-core    noarch    2.1.5-1.fc27      fedora-latest    141 k\n\nTransaction Summary\n================================================================================\nInstall    1 Package\nDowngrade  2 Packages\n\nTotal size: 232 k\nDownloading Packages:\n[SKIPPED] dnf-plugins-core-2.1.5-1.fc27.noarch.rpm: Already downloaded         \n[SKIPPED] python3-dnf-plugins-core-2.1.5-1.fc27.noarch.rpm: Already downloaded \n[SKIPPED] dnf-utils-2.1.5-1.fc27.noarch.rpm: Already downloaded                \nRunning transaction check\nTransaction check succeeded.\nRunning transaction test\nThe downloaded packages were saved in cache until the next successful transaction.\nYou can remove cached packages by executing 'dnf clean packages'.", "stdout_lines": ["Last metadata expiration check: 0:34:33 ago on Mon 26 Feb 2018 09:19:26 AM CET.", "Dependencies resolved.", "================================================================================", " Package                     Arch      Version           Repository        Size", "================================================================================", "Installing:", " dnf-utils                   noarch    2.1.5-1.fc27      fedora-latest     41 k", "Downgrading:", " dnf-plugins-core            noarch    2.1.5-1.fc27      fedora-latest     51 k", " python3-dnf-plugins-core    noarch    2.1.5-1.fc27      fedora-latest    141 k", "", "Transaction Summary", "================================================================================", "Install    1 Package", "Downgrade  2 Packages", "", "Total size: 232 k", "Downloading Packages:", "[SKIPPED] dnf-plugins-core-2.1.5-1.fc27.noarch.rpm: Already downloaded         ", "[SKIPPED] python3-dnf-plugins-core-2.1.5-1.fc27.noarch.rpm: Already downloaded ", "[SKIPPED] dnf-utils-2.1.5-1.fc27.noarch.rpm: Already downloaded                ", "Running transaction check", "Transaction check succeeded.", "Running transaction test", "The downloaded packages were saved in cache until the next successful transaction.", "You can remove cached packages by executing 'dnf clean packages'."]}

For make check-in-vm, log is following.

09:56 $ make check-in-vm
TEST_SUBJECTS=../Fedora-Cloud-Base-27-1.6.x86_64.qcow2 ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 -e subject="" -i /usr/share/ansible/inventory/standard-inventory-qcow2 -e setup=true -e vm_image= ./in-vm.yml
Launching virtual machine for ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
standard-inventory-qcow2: could not access launched qcow2 image: ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with script plugin: Inventory script (/usr/share/ansible/inventory/standard-inventory-qcow2) had an execution error:

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with yaml plugin: Syntax Error while loading YAML.   The error appears to have been in '/usr/share/ansible/inventory
/standard-inventory-qcow2': line 49, column 6, but may be elsewhere in the file depending on the exact syntax problem.  The offending line appears to be:  USER_DATA = """#cloud-config users:      ^ here
exception type: <class 'yaml.scanner.ScannerError'> exception: mapping values are not allowed in this context   in "<unicode string>", line 49, column 6

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with ini plugin: /usr/share/ansible/inventory/standard-inventory-qcow2:3: Expected key=value host variable assignment, got:
argparse

 [WARNING]: Unable to parse /usr/share/ansible/inventory/standard-inventory-qcow2 as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [Integration tests for tools container image executed in current environment] ********************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Install the container engine] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [Start the container engine] *********************************************************************************************************************************************************************************
ok: [localhost]

TASK [Pull the test subject (=container image)] *******************************************************************************************************************************************************************
skipping: [localhost]

TASK [Create temporary directory for the image] *******************************************************************************************************************************************************************
changed: [localhost -> localhost]

TASK [Save the image to a file] ***********************************************************************************************************************************************************************************
fatal: [localhost -> localhost]: FAILED! => {"changed": true, "cmd": ["docker", "save", "-o", "/tmp/ansible.z6gkhwwe/image.tar.gz"], "delta": "0:00:00.012412", "end": "2018-02-26 10:03:42.235726", "msg": "non-zero return code", "rc": 1, "start": "2018-02-26 10:03:42.223314", "stderr": "\"docker save\" requires at least 1 argument(s).\nSee 'docker save --help'.\n\nUsage:  docker save [OPTIONS] IMAGE [IMAGE...]\n\nSave one or more images to a tar archive (streamed to STDOUT by default)", "stderr_lines": ["\"docker save\" requires at least 1 argument(s).", "See 'docker save --help'.", "", "Usage:  docker save [OPTIONS] IMAGE [IMAGE...]", "", "Save one or more images to a tar archive (streamed to STDOUT by default)"], "stdout": "", "stdout_lines": []}

PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost                  : ok=4    changed=1    unreachable=0    failed=1   

make: *** [Makefile:12: check-in-vm] Error 2
✘-2 ~/work/container-images/tools/tests [TomasTomecek-add-tests L|✚ 1…1] 
10:03 $ 

tests/in-vm.yml Outdated
- python3-pytest

tests:
- integration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please describe it? It is called like integration? More comments are welcome for understanding dummies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you're right that comment is missing, will add.

- name: Copy test subject from host inside the VM
block:
# FIXME: make this configurable
- name: Create temporary directory for the image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where it creates a directory? In /tmp. Please make the comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://docs.ansible.com/ansible/latest/tempfile_module.html this is ansible 101, I'm not gonna comment on that

@TomasTomecek
Copy link
Member Author

Seems like conflict between dnf-utils and yum-utils.

That's an issue of standard-test-roles, we need to fix it over there.

make check-in-vm

I'll add a "debug mode" so that it's easy to figure out what's wrong.

@TomasTomecek
Copy link
Member Author

Updated. Please rerun with make check-in-vm DEBUG_MODE=1.

Would it be possible actually to get rid of yum-utils on your local system?

Sample logs

@phracek
Copy link
Member

phracek commented Feb 26, 2018

Couple updates:

TASK [Create temporary directory for the image] *****************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:53
changed: [localhost -> localhost] => {"changed": true, "gid": 1000, "group": "phracek", "mode": "0700", "owner": "phracek", "path": "/tmp/ansible.ma1t69te", "size": 40, "state": "directory", "uid": 1000}

TASK [Save the image to a file] *********************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:57
changed: [localhost -> localhost] => {"changed": true, "cmd": ["docker", "save", "-o", "/tmp/ansible.ma1t69te/image.tar.gz", "docker.io/modularitycontainers/tools"], "delta": "0:00:11.972715", "end": "2018-02-26 12:45:10.158572", "rc": 0, "start": "2018-02-26 12:44:58.185857", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [Copy the image from host to the target] *******************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:59
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible_ssh_private_key_file' is undefined\n\nThe error appears to have been in '/home/phracek/work/container-images/tools/tests/in-vm.yml': line 59, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n      command: 'docker save -o {{ tmp.path + \"/image.tar.gz\" }} {{ subject }}'\n    - name: Copy the image from host to the target\n      ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'ansible_ssh_private_key_file' is undefined"}

PLAY RECAP ******************************************************************************************************************************************************************
localhost                  : ok=5    changed=2    unreachable=0    failed=1   

@TomasTomecek
Copy link
Member Author

hmmm, seems like a change in behaviour in ansible, because that variable is defined for me:

"ansible_ssh_private_key_file": "/tmp/inventory-cloud4EDuk6/identity"

what version of ansible do you have? I have ansible-2.4.3.0-2.fc28.noarch

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
@phracek
Copy link
Member

phracek commented Feb 26, 2018

I have ansible-2.4.3.0-1.fc27.noarch

@TomasTomecek
Copy link
Member Author

The issue Petr has is:

Launching virtual machine for ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
standard-inventory-qcow2: could not access launched qcow2 image: ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with script plugin: Inventory script (/usr/share/ansible/inventory/standard-inventory-
qcow2) had an execution error:

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with yaml plugin: Syntax Error while loading YAML.   The error appears to have been in
'/usr/share/ansible/inventory/standard-inventory-qcow2': line 49, column 6, but may be elsewhere in the file depending on the exact syntax problem.  The offending line
appears to be:  USER_DATA = """#cloud-config users:      ^ here  exception type: <class 'yaml.scanner.ScannerError'> exception: mapping values are not allowed in this
context   in "<unicode string>", line 49, column 6

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with ini plugin: /usr/share/ansible/inventory/standard-inventory-qcow2:3: Expected
key=value host variable assignment, got: argparse

 [WARNING]: Unable to parse /usr/share/ansible/inventory/standard-inventory-qcow2 as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

Is this a bug in standard-test-roles/ansible? @phracek what version of standard-test-roles you have?

@phracek
Copy link
Member

phracek commented Feb 27, 2018

On my system I have installed standard-test-roles-2.8-1.fc27.noarch

@TomasTomecek
Copy link
Member Author

That's exactly what I have as well.

I wonder if you can invoke the inventory script directly:

$ /usr/share/ansible/inventory/standard-inventory-qcow2 ./Fedora-Cloud-Base-27-1.6.x86_64.qcow2
Launching virtual machine for ./Fedora-Cloud-Base-27-1.6.x86_64.qcow2
{
    "subjects": {
        "hosts": [
            "./Fedora-Cloud-Base-27-1.6.x86_64.qcow2"
        ],
        "vars": {}
    },
    "_meta": {
        "hostvars": {
            "./Fedora-Cloud-Base-27-1.6.x86_64.qcow2": {
                "ansible_ssh_common_args": "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no",
                "ansible_ssh_private_key_file": "/tmp/inventory-cloudNPGMHi/identity",
                "ansible_ssh_pass": "foobar",
                "ansible_ssh_host": "127.0.0.3",
                "ansible_ssh_user": "root",
                "ansible_ssh_port": "2222"
            }
        }
    },
    "localhost": {
        "hosts": [
            "./Fedora-Cloud-Base-27-1.6.x86_64.qcow2"
        ],
        "vars": {}
    }
}

@phracek
Copy link
Member

phracek commented Feb 27, 2018

Well, running with sudo all works fine:

$ sudo make check-in-vm DEBUG_MODE=1
docker build --tag=docker.io/modularitycontainers/tools .
Sending build context to Docker daemon 371.2 kB
Step 1/7 : FROM registry.fedoraproject.org/fedora:27
 ---> 9881e4229c95
Step 2/7 : LABEL maintainer "Tomas Tomecek \"ttomecek@redhat.com\""
 ---> Using cache
 ---> b2242fa6293b
Step 3/7 : ENV NAME tools VERSION 0 RELEASE 1 ARCH x86_64
 ---> Using cache
 ---> 8907f8927725
Step 4/7 : LABEL com.redhat.component "$NAME" name "$FGC/$NAME" version "$VERSION" release "$RELEASE.$DISTTAG" architecture "$ARCH" run "docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e HOST=/host -e NAME=NAME -e IMAGE=IMAGE -v /run:/run -v /var/log:/var/log -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -v /:/host IMAGE" summary "container with all the management tools you miss in Atomic Host"
 ---> Using cache
 ---> 66409672f18c
Step 5/7 : RUN dnf remove -y vim-minimal && dnf install -y   bash-completion   bc   bind-utils   blktrace   crash   e2fsprogs   ethtool   file   gcc   gdb   git-core   glibc-utils   gomtree   htop   hwloc   iotop   iproute   iputils   less   ltrace   mailx   net-tools   netsniff-ng   nmap-ncat   numactl   numactl-devel   parted   pciutils   perf   procps-ng   psmisc   rpm-build   screen   sos   strace   sysstat   tcpdump   tmux   vim-enhanced   xfsprogs   && dnf clean all
 ---> Using cache
 ---> d33e559b9090
Step 6/7 : COPY ./root/ /
 ---> Using cache
 ---> 1f21223a0df4
Step 7/7 : CMD /usr/bin/bash
 ---> Using cache
 ---> c13085a71680
Successfully built c13085a71680
make -C tests/ check-in-vm IMAGE_NAME=docker.io/modularitycontainers/tools ANSIBLE_EXTRA_ARGS=-vv
make[1]: Entering directory '/home/phracek/work/container-images/tools/tests'
TEST_SUBJECTS=../Fedora-Cloud-Base-27-1.6.x86_64.qcow2 ansible-playbook -vv -e ansible_python_interpreter=/usr/bin/python3 -e subject=docker.io/modularitycontainers/tools -e ansible_ssh_private_key_file=/home/phracek/.ssh/id_rsa.pub -i /usr/share/ansible/inventory/standard-inventory-qcow2 -e setup=true -e vm_image= ./in-vm.yml
ansible-playbook 2.4.3.0
  config file = /home/phracek/work/container-images/tools/tests/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible-playbook
  python version = 2.7.14 (default, Feb 17 2018, 10:42:17) [GCC 7.3.1 20180130 (Red Hat 7.3.1-2)]
Using /home/phracek/work/container-images/tools/tests/ansible.cfg as config file
Launching virtual machine for ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
standard-inventory-qcow2: could not access launched qcow2 image: ../Fedora-Cloud-Base-27-1.6.x86_64.qcow2
 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with script plugin: Inventory script (/usr/share/ansible/inventory/standard-inventory-qcow2) had an
execution error:

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with yaml plugin: Syntax Error while loading YAML.   The error appears to have been in
'/usr/share/ansible/inventory/standard-inventory-qcow2': line 49, column 6, but may be elsewhere in the file depending on the exact syntax problem.  The offending line appears to be:
USER_DATA = """#cloud-config users:      ^ here  exception type: <class 'yaml.scanner.ScannerError'> exception: mapping values are not allowed in this context   in "<unicode string>", line
49, column 6

 [WARNING]:  * Failed to parse /usr/share/ansible/inventory/standard-inventory-qcow2 with ini plugin: /usr/share/ansible/inventory/standard-inventory-qcow2:3: Expected key=value host
variable assignment, got: argparse

 [WARNING]: Unable to parse /usr/share/ansible/inventory/standard-inventory-qcow2 as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

statically imported: /etc/ansible/roles/str-common/tasks/inspect.yml
statically imported: /etc/ansible/roles/str-common/tasks/trunner.yml
statically imported: /etc/ansible/roles/str-common/tasks/inspect.yml
statically imported: /etc/ansible/roles/str-common/tasks/pkgs.yml

PLAYBOOK: in-vm.yml **************************************************************************************************************************************************************************
1 plays in ./in-vm.yml

PLAY [Integration tests for tools container image executed in current environment] ***********************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************************
ok: [localhost]
META: ran handlers

TASK [Install the container engine] **********************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:34
ok: [localhost] => {"changed": false, "msg": "Nothing to do"}

TASK [Start the container engine] ************************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:39
ok: [localhost] => {"changed": false, "name": "docker", "state": "started", "status": {"ActiveEnterTimestamp": "Mon 2018-02-26 16:11:19 CET", "ActiveEnterTimestampMonotonic": "9289628", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "basic.target docker-containerd.service systemd-journald.socket network.target docker-storage-setup.service sysinit.target system.slice registries.service", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Mon 2018-02-26 16:11:17 CET", "AssertTimestampMonotonic": "7882801", "Before": "multi-user.target sssd.service shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CPUUsageNSec": "18446744073709551615", "CPUWeight": "18446744073709551615", "CanIsolate": "no", "CanReload": "yes", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Mon 2018-02-26 16:11:17 CET", "ConditionTimestampMonotonic": "7882800", "Conflicts": "shutdown.target", "ControlGroup": "/system.slice/docker.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Docker Application Container Engine", "DevicePolicy": "auto", "Documentation": "http://docs.docker.com", "DynamicUser": "no", "Environment": "GOTRACEBACK=crash", "EnvironmentFile": "/etc/sysconfig/docker-network (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "1104", "ExecMainStartTimestamp": "Mon 2018-02-26 16:11:17 CET", "ExecMainStartTimestampMonotonic": "7884323", "ExecMainStatus": "0", "ExecReload": "{ path=/bin/kill ; argv[]=/bin/kill -s HUP $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStart": "{ path=/usr/bin/dockerd-current ; argv[]=/usr/bin/dockerd-current --add-runtime oci=/usr/libexec/docker/docker-runc-current --default-runtime=oci --authorization-plugin=rhel-push-plugin --containerd /run/containerd.sock --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES ; ignore_errors=no ; start_time=[Mon 2018-02-26 16:11:17 CET] ; stop_time=[n/a] ; pid=1104 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/usr/lib/systemd/system/docker.service", "GID": "4294967295", "GuessMainPID": "yes", "IOAccounting": "no", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "18446744073709551615", "Id": "docker.service", "IgnoreOnIsolate": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Mon 2018-02-26 16:11:17 CET", "InactiveExitTimestampMonotonic": "7884355", "InvocationID": "cd42d0d170614a3283f86c4ba798f82e", "JobRunningTimeoutUSec": "infinity", "JobTimeoutAction": "none", "JobTimeoutUSec": "infinity", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitASSoft": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCORESoft": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitCPUSoft": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitDATASoft": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitFSIZESoft": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitLOCKSSoft": "18446744073709551615", "LimitMEMLOCK": "65536", "LimitMEMLOCKSoft": "65536", "LimitMSGQUEUE": "819200", "LimitMSGQUEUESoft": "819200", "LimitNICE": "0", "LimitNICESoft": "0", "LimitNOFILE": "1048576", "LimitNOFILESoft": "1048576", "LimitNPROC": "1048576", "LimitNPROCSoft": "1048576", "LimitRSS": "18446744073709551615", "LimitRSSSoft": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "18446744073709551615", "LimitRTTIMESoft": "18446744073709551615", "LimitSIGPENDING": "46729", "LimitSIGPENDINGSoft": "46729", "LimitSTACK": "18446744073709551615", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "MainPID": "1104", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryDenyWriteExecute": "no", "MemoryHigh": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MemoryLow": "0", "MemoryMax": "18446744073709551615", "MemorySwapMax": "18446744073709551615", "MountAPIVFS": "no", "MountFlags": "0", "NFileDescriptorStore": "0", "Names": "docker.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "main", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "Perpetual": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "RemoveIPC": "no", "RequiredBy": "sssd.service", "Requires": "docker-containerd.service sysinit.target rhel-push-plugin.socket system.slice registries.service", "Restart": "on-abnormal", "RestartUSec": "100ms", "RestrictNamespaces": "no", "RestrictRealtime": "no", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "RuntimeMaxUSec": "infinity", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitIntervalSec": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StartupCPUWeight": "18446744073709551615", "StartupIOWeight": "18446744073709551615", "StateChangeTimestamp": "Mon 2018-02-26 16:11:19 CET", "StateChangeTimestampMonotonic": "9289628", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogFacility": "3", "SyslogLevel": "6", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "14", "TasksMax": "8192", "TimeoutStartUSec": "infinity", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "notify", "UID": "4294967295", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "UtmpMode": "init", "WantedBy": "multi-user.target", "Wants": "sssd.service docker-storage-setup.service", "WatchdogTimestamp": "Mon 2018-02-26 16:11:19 CET", "WatchdogTimestampMonotonic": "9289626", "WatchdogUSec": "0"}}

TASK [Pull the test subject (=container image)] **********************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:46
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [Create temporary directory for the image] **********************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:53
changed: [localhost -> localhost] => {"changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.qme13gkq", "size": 40, "state": "directory", "uid": 0}

TASK [Save the image to a file] **************************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:57
changed: [localhost -> localhost] => {"changed": true, "cmd": ["docker", "save", "-o", "/tmp/ansible.qme13gkq/image.tar.gz", "docker.io/modularitycontainers/tools"], "delta": "0:00:12.895992", "end": "2018-02-27 12:12:36.645450", "rc": 0, "start": "2018-02-27 12:12:23.749458", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [Copy the image from host to the target] ************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:59
changed: [localhost -> localhost] => {"changed": true, "cmd": "/bin/rsync --delay-updates -F --compress --archive --out-format=<<CHANGED>>%i %n%L /tmp/ansible.qme13gkq/image.tar.gz /tmp/", "msg": ">f+++++++++ image.tar.gz\n", "rc": 0, "stdout_lines": [">f+++++++++ image.tar.gz"]}

TASK [file] **********************************************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:66
changed: [localhost -> localhost] => {"changed": true, "path": "/tmp/ansible.qme13gkq", "state": "absent"}

TASK [Load the image on the target into dockerd] *********************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:73
changed: [localhost] => {"changed": true, "cmd": ["docker", "load", "-i", "/tmp/image.tar.gz"], "delta": "0:00:00.726768", "end": "2018-02-27 12:13:08.585036", "rc": 0, "start": "2018-02-27 12:13:07.858268", "stderr": "", "stderr_lines": [], "stdout": "Loaded image: docker.io/modularitycontainers/tools:latest", "stdout_lines": ["Loaded image: docker.io/modularitycontainers/tools:latest"]}

TASK [file] **********************************************************************************************************************************************************************************
task path: /home/phracek/work/container-images/tools/tests/in-vm.yml:75
changed: [localhost] => {"changed": true, "path": "/tmp/image.tar.gz", "state": "absent"}

TASK [str-common : Check if system is Atomic Host] *******************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:2
ok: [localhost] => {"backup": "", "changed": false, "found": 0, "msg": ""}

TASK [str-common : Set fact 'is_atomic'] *****************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:10
ok: [localhost] => {"ansible_facts": {"is_atomic": false}, "changed": false}

TASK [str-common : Set facts about system] ***************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:15
ok: [localhost] => {"ansible_facts": {"is_dnf_os": "True\n", "is_yum_os": "False\n"}, "changed": false}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/main.yml:3
ok: [localhost] => {
    "msg": "System uses yum: False\n"
}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/main.yml:7
ok: [localhost] => {
    "msg": "System uses dnf: True\n"
}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/main.yml:11
ok: [localhost] => {
    "msg": "System is Atomic Host: False"
}

TASK [str-common : Add test-runner to ansible inventory] *************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:1
creating host via 'add_host': hostname=test-runner
changed: [localhost] => {"add_host": {"groups": [], "host_name": "test-runner", "host_vars": {"ansible_connection": "local"}}, "changed": true}

TASK [str-common : Gather facts] *************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:8
ok: [localhost -> test-runner]

TASK [str-common : Check if system is Atomic Host] *******************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:2
ok: [localhost -> test-runner] => {"backup": "", "changed": false, "found": 0, "msg": ""}

TASK [str-common : Set fact 'is_atomic'] *****************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:10
ok: [localhost -> test-runner] => {"ansible_facts": {"is_atomic": false}, "changed": false}

TASK [str-common : Set facts about system] ***************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/inspect.yml:15
ok: [localhost -> test-runner] => {"ansible_facts": {"is_dnf_os": "True\n", "is_yum_os": "False\n"}, "changed": false}

TASK [str-common : Fetch tests from remote repositories] *************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:14
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:23
ok: [localhost] => {
    "msg": "test-runner is: Fedora\n"
}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:29
ok: [localhost] => {
    "msg": "test-runner uses yum: False\n"
}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/trunner.yml:35
ok: [localhost] => {
    "msg": "test-runner uses dnf: True\n"
}

TASK [str-common : Build packages lists to be present on test environment] *******************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs.yml:1
ok: [localhost] => {"ansible_facts": {"pkg_mgr": "dnf\n", "pkgs_debuginfo_req": [], "pkgs_ordinary_req": ["python3-conu", "python3-pytest"]}, "changed": false}

TASK [str-common : debug] ********************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs.yml:25
ok: [localhost] => {
    "msg": "Package manager: dnf\n"
}

TASK [str-common : include_tasks] ************************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs.yml:29
included: /etc/ansible/roles/str-common/tasks/pkgs-dnf.yml for localhost

TASK [str-common : Install test-specific package requirements] *******************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs-dnf.yml:1
ok: [localhost] => (item=python3-conu) => {"changed": false, "item": "python3-conu", "msg": "Nothing to do"}
ok: [localhost] => (item=python3-pytest) => {"changed": false, "item": "python3-pytest", "msg": "Nothing to do"}

TASK [str-common : Install the common requirements on target] ********************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs-dnf.yml:7
ok: [localhost] => (item=rsync) => {"changed": false, "item": "rsync", "msg": "Nothing to do"}

TASK [str-common : Install dnf-utils] ********************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs-dnf.yml:13
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [str-common : Install debuginfo packages] ***********************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/pkgs-dnf.yml:19

TASK [str-common : Make artifacts directory] *************************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/main.yml:18
changed: [localhost] => {"changed": true, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/tmp/artifacts/", "size": 40, "state": "directory", "uid": 0}

TASK [str-common : Copy tests to test environment] *******************************************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/main.yml:22
changed: [localhost] => {"changed": true, "cmd": "/bin/rsync --delay-updates -F --compress --archive --out-format=<<CHANGED>>%i %n%L /home/phracek/work/container-images/tools/tests/ /var/str/", "msg": "cd+++++++++ ./\n>f+++++++++ Makefile\n>f+++++++++ ansible.cfg\n>f+++++++++ in-vm.yml\n>f+++++++++ inventory\n>f+++++++++ local.yml\ncd+++++++++ artifacts/\n>f+++++++++ artifacts/Fedora-Cloud-Base-27-1.6.x86_64.qcow2.log\ncd+++++++++ integration/\n>f+++++++++ integration/runtest.sh\n>f+++++++++ integration/test_container.py\n", "rc": 0, "stdout_lines": ["cd+++++++++ ./", ">f+++++++++ Makefile", ">f+++++++++ ansible.cfg", ">f+++++++++ in-vm.yml", ">f+++++++++ inventory", ">f+++++++++ local.yml", "cd+++++++++ artifacts/", ">f+++++++++ artifacts/Fedora-Cloud-Base-27-1.6.x86_64.qcow2.log", "cd+++++++++ integration/", ">f+++++++++ integration/runtest.sh", ">f+++++++++ integration/test_container.py"]}

TASK [standard-test-basic : Execute tests] ***************************************************************************************************************************************************
task path: /etc/ansible/roles/standard-test-basic/tasks/main.yml:4
changed: [localhost] => (item=integration) => {"changed": true, "cmd": "logfile=/tmp/artifacts//test.$(echo $TEST | sed -e 's/\\//-/g').log\n exec 2>>$logfile 1>>$logfile\n cd $TEST_DIR\n #make script executable\n chmod 0775 $(echo $TEST_CMD | awk '{print $1;}')\n #execute the test\n eval $TEST_CMD\n if [ $? -eq 0 ]; then\n echo \"PASS $TEST\" >> /tmp/artifacts//test.log\n else\n echo \"FAIL $TEST\" >> /tmp/artifacts//test.log\n fi", "delta": "0:00:03.411866", "end": "2018-02-27 12:13:26.211397", "item": "integration", "rc": 0, "start": "2018-02-27 12:13:22.799531", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [standard-test-basic : Check the results] ***********************************************************************************************************************************************
task path: /etc/ansible/roles/standard-test-basic/tasks/main.yml:34
changed: [localhost] => {"changed": true, "cmd": "grep \"^FAIL\" /tmp/artifacts//test.log", "delta": "0:00:00.003124", "end": "2018-02-27 12:13:26.569754", "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "start": "2018-02-27 12:13:26.566630", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [standard-test-basic : include_role] ****************************************************************************************************************************************************
task path: /etc/ansible/roles/standard-test-basic/tasks/main.yml:39

TASK [str-common : Pull out the logs from test environment to test runner] *******************************************************************************************************************
task path: /etc/ansible/roles/str-common/tasks/end.yml:3
changed: [localhost] => {"changed": true, "cmd": "/bin/rsync --delay-updates -F --compress --archive --out-format=<<CHANGED>>%i %n%L /tmp/artifacts// /home/phracek/work/container-images/tools/tests/artifacts//", "msg": ".d..tpog... ./\n>f+++++++++ test.integration.log\n>f+++++++++ test.log\n", "rc": 0, "stdout_lines": [".d..tpog... ./", ">f+++++++++ test.integration.log", ">f+++++++++ test.log"]}
META: ran handlers
META: ran handlers

PLAY RECAP ***********************************************************************************************************************************************************************************
localhost                  : ok=33   changed=12   unreachable=0    failed=0   

make[1]: Leaving directory '/home/phracek/work/container-images/tools/tests'

@phracek
Copy link
Member

phracek commented Feb 27, 2018

Tests are still failing. :( python3-xattr is not available in Travis CI.

@TomasTomecek
Copy link
Member Author

Oh my, you are so brave. I would not run such thing as root.

Anyway, the problem still persists - the inventory script is failing the same way.

@dhodovsk
Copy link

I think I am still a bit confused and have some questions, sorry about that:
Is this a manual to add test invoking functionality to an image or will the tests added here be used broadly when testing all images in our CI? What are the minimal steps to activate CI tests in an image?

@TomasTomecek
Copy link
Member Author

Is this a manual to add test invoking functionality to an image

...to a dist-git repo, to be precise. Bear in mind this is just a prototype and we want the glue code (in this case local.yaml and in-vm.yaml) to be minimal. So that's why we likely want to create a new role in standard-test-roles which will do exactly what these two playbooks can do.

will the tests added here be used broadly when testing all images in our CI?

No, this work is aimed to support universal invocation of image-specific tests -- you invoke the tests the same way locally on your laptop, in Fedora CI, in internal CI, in external CI or on the beach.

What are the minimal steps to activate CI tests in an image?

I don't follow. Ideally, people would just stick a file in their dist-git repo and that file would be recognized by all CI systems so they would be able to invoke the tests.

The way it works right now is that you put a file tests/tests.yaml in your dist-git repo and the CI system knows that the file is an Ansible playbook and runs it. Ideally, we want the same thing for containers.

@phracek
Copy link
Member

phracek commented Mar 1, 2018

I have filed an issue in standard-test-roles https://pagure.io/standard-test-roles/issue/134.

@phracek
Copy link
Member

phracek commented Mar 1, 2018

curl -O command is wrong. It should point to http://mirror.vutbr.cz/fedora//releases/27/CloudImages/x86_64/images/Fedora-Cloud-Base-27-1.6.x86_64.qcow2

@TomasTomecek
Copy link
Member Author

TomasTomecek commented Mar 5, 2018

whoops, my bad; I forgot adding -L since mirror manager redirects to closest mirror

Edit: should be correct now

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM .

@TomasTomecek TomasTomecek merged commit 70f9184 into container-images:master Aug 22, 2018
@TomasTomecek TomasTomecek deleted the add-tests branch August 22, 2018 10:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants