Create jacoco exec file out of gradle project dir

How can I change the location of the jacoco exec file to be out of project directory, from a custom gradle plugin. I have below code in my plugin : project.afterEvaluate { def testTasks =...

When is chr(ord(c)) not equal to c in Python?

I am reading the source code of testinfra in the Ansible module. I found the following lines of code: # Ansible return an unicode object but this is bytes ... # A simple test case is: ...

How to get target OS type in Testinfra when running a test remotely?

Within Testinfra, how can I create a test condition for the target operating system (if at all)? I'd like to run the test on target host through: $ testinfra -v --host=target test.py I...

How to test a cluster of microservices?

I took a look into Server Spec and it says it clearly: Remark: serverspec test suites are meant to be run against a single machine (or docker container). In other words, you should not try to...

Testinfra ssh execution with private key

Using testinfra (Pytest plugin) for testing. I want to test remote hosts from Jenkins using a private key. [[email protected] tests]# testinfra --ssh-config=/path/to/private/key \ --sudo...

How to disable Molecule idempotence check on Ansible role test?

Using Molecule v.2 to test Ansible roles, I faced an issue with the check for a role to be idempotent. How can I disable this check? As documented, Molecule configuration parameters are required...

Using Ansible variables in testinfra

Using TestInfra with Ansible backend for testing purposes. Everything goes fine except using Ansible itself while running tests test.py import pytest def test_zabbix_agent_package(host): ...

ORA-12505, TNS:listener does not currently know of SID given in connect

I'm using JDeveloper when I try to create a database connection with the hr/hr user I get this message: Listener refused the connection with the following error: ORA-12505, TNS:listener does not...

Set a variable based on a py.test (testinfra) check output

I am trying to make a testinfra test file more portable, I'd like to use a single file to handle tests for either a prod / dev or test env. For this I need to get a value from the remote tested...

test ansible roles with molecule and boto3

I have ansible roles that creates servers, S3 buckets, security groups ... and I want to establish some unit testing using Molecule. After some researches, I found out that Molecule is using...

pytest: How do I read a list of fixtures from a file?

I would like to pytest (via TestInfra) to assert the presence of packages on a host. I have a list of packages that should be there in a text file, which I can read and put in an array. I would...

Failing to connect to localhost from inside a container Connection refused

I'm currently testing an Ansible role using Molecule. Basically, Molecule launches a container that is Ansible compliant and runs the role on it. In order to test the container, Molecule also...

Testinfra not seeing nginx when run through Molecule

I don't understand what I am missing. I am trying to run a basic test from the documentation to see if my Ansible role deploys and runs nginx. I can login to the VM and verify, but that defeats...

IOError: [Errno 2] No such file or directory - on linux, using absolute path

I am struggling to find the solution for this. I am using an absolute path that definitely exists in the file system. When same exact path is used in same script with if...

Create and use a PyPi proxy repository on nexus

Running Nexus 3 OSS 3.6.0-02 I have created a pypi proxy repository on nexus using this guide: https://help.sonatype.com/repomanager3/pypi-repositories With the following info: Format: pypi Type:...

How to test install and uninstall scenario with Molecule for Ansible?

In the Ansible role that I'm creating, I'm covering both an install and an uninstall scenario: foo-install.yml is called from main.yml when the install flag is set to true. foo-uninstall.yml is...

How to get IP/Hostname of All Hosts in a Molecule / TestInfra test?

i have a simple role, which just gets the ip/hostnames of all hosts in the play, and updates the /etc/hosts file. - name: Add the inventory into /etc/hosts lineinfile: dest: /etc/hosts ...

Using fixtures at collect time in pytest

I use testinfra with ansible transport. It provides host fixture which has ansible, so I can do host.ansible.get_variables(). Now I need to create a parametrization of test based on value from...

Accessing Ansible variables in molecule test, TestInfra

I picked up molecule while researching around inspec and how to use it in ansible. I found molecule very cool and adopted it. I wanted to use it in 2 ways. 1- When developing a role or playbook 2-...

How to debug your tests when using testinfra as verifier in Molecule

When testing an ansible role using molecule tool and verifying the result with testinfra(pytest), I am not able to print or debug certain output or an ansible...

ansible ... molecule.yml - how to refer to env variables define in same file?

I cam trying to restructure a molecule file to use a common playbook to reduce code duplication. I can get it to work with a relative path but using referring to the other playbook relative to env...

How do I SSH to molecule instance without molecule login

I'm using molecule and vagrant to deploy centos7 instance. For some reasons, I need to use ssh command access molecule instance, instead of molecule login. The ssh informations will then paste...

override defaults/main.yml variables with molecule

I have the problem where my default values are normally stored in defaults/main.yml for running ansible scripts but I have not found a way to override them. I am using molecule to test, and I want...

How to use molecule with Openstack

I use molecule a lot with the docker driver. There are a few cases where docker is not the right tool to test ansible roles against, so I'd like to spin up a vm in openstack. I've created an...

Is there any good examples for molecule roles that uses kvm? so far getting {'lint': ['must be of string type']} error

I've being trying to run find good repositories or examples of using molecule with kvm. But so far all of them gets this. {'lint': ['must be of string type']} I have no clue how to fix this. Like...

Molecule : Testing roles : Failed to get Dbus Connection Operation not permitted

I facing an issue on my Molecule Test. I have begin to study this tool 2 days ago for information. on a Ubuntu VM running with Vagrant,I have create a role and initialze Molecule's folder and...

Same command through Ansible shell module produces a different result from direct execution in terminal

I am battling with an existing ansible MongoDB role that I am updating with ansible-molecule. The full role folder, with tasks/molecul files, is simplified and uploaded to gofile . That can be...

Using an array of testinfra_hosts, can you control the parametrized values used for each host in a test?

I'm trying to write a test suite for verifying the state of some servers using testinfra. It's my first time working with python/testinfra/pytest. As a brief pseudocodey...

Terratest multiple targets

I am using terrates to test my terraform code. My code have 2 modules so I managed to configure terratest to use target option while configuring the terraformOptions and it creates both...

How can I run pytest (and doctests) on Python files without .py extension?

In some cases, for system scripts I like to keep the extension out and use a shebang. Unfortunately pytest seems to ignore these files and doctest fails because it cannot import these files....