[arch-commits] Commit in molecule-vagrant/trunk (105.patch PKGBUILD)

Ike Devolder idevolder at gemini.archlinux.org
Thu Nov 18 08:21:17 UTC 2021


    Date: Thursday, November 18, 2021 @ 08:21:17
  Author: idevolder
Revision: 1052062

upgpkg: molecule-vagrant 0.6.3-2

add patch for FS#72567

Added:
  molecule-vagrant/trunk/105.patch
Modified:
  molecule-vagrant/trunk/PKGBUILD

-----------+
 105.patch |  151 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD  |   11 +++-
 2 files changed, 159 insertions(+), 3 deletions(-)

Added: 105.patch
===================================================================
--- 105.patch	                        (rev 0)
+++ 105.patch	2021-11-18 08:21:17 UTC (rev 1052062)
@@ -0,0 +1,151 @@
+From 2d481a3e8d52a0ba9f7be7834571766178b0e806 Mon Sep 17 00:00:00 2001
+From: Arnaud Patard <apatard at hupstream.com>
+Date: Sat, 15 May 2021 20:59:40 +0200
+Subject: [PATCH 1/2] molecule_vagrant/test/functional: Add scenario for
+ networking
+
+There's currently no test case for networking, which seems a bad
+idea, so add one.
+The verifier playbook is minimal: it's only checking that there
+are 3 interfaces (lo, management network, private network).
+
+Signed-off-by: Arnaud Patard <apatard at hupstream.com>
+---
+ .github/workflows/tox.yml                     |  8 +++----
+ molecule_vagrant/test/functional/test_func.py |  3 ++-
+ .../scenarios/molecule/network/converge.yml   | 11 +++++++++
+ .../scenarios/molecule/network/molecule.yml   | 23 +++++++++++++++++++
+ .../scenarios/molecule/network/verify.yml     | 10 ++++++++
+ 5 files changed, 50 insertions(+), 5 deletions(-)
+ create mode 100644 molecule_vagrant/test/scenarios/molecule/network/converge.yml
+ create mode 100644 molecule_vagrant/test/scenarios/molecule/network/molecule.yml
+ create mode 100644 molecule_vagrant/test/scenarios/molecule/network/verify.yml
+
+diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml
+index f2ffb9d..5b4fb53 100644
+--- a/.github/workflows/tox.yml
++++ b/.github/workflows/tox.yml
+@@ -26,13 +26,13 @@ jobs:
+         include:
+           - tox_env: lint
+           - tox_env: py36
+-            PREFIX: PYTEST_REQPASS=5
++            PREFIX: PYTEST_REQPASS=6
+           - tox_env: py36-devel
+-            PREFIX: PYTEST_REQPASS=5
++            PREFIX: PYTEST_REQPASS=6
+           - tox_env: py39
+-            PREFIX: PYTEST_REQPASS=5
++            PREFIX: PYTEST_REQPASS=6
+           - tox_env: py39-devel
+-            PREFIX: PYTEST_REQPASS=5
++            PREFIX: PYTEST_REQPASS=6
+           - tox_env: packaging
+ 
+     steps:
+diff --git a/molecule_vagrant/test/functional/test_func.py b/molecule_vagrant/test/functional/test_func.py
+index 3b21fa9..826b9eb 100644
+--- a/molecule_vagrant/test/functional/test_func.py
++++ b/molecule_vagrant/test/functional/test_func.py
+@@ -71,7 +71,8 @@ def test_command_init_scenario(temp_dir):
+ 
+ 
+ @pytest.mark.parametrize(
+-    "scenario", [("vagrant_root"), ("config_options"), ("provider_config_options")]
++    "scenario",
++    [("vagrant_root"), ("config_options"), ("provider_config_options"), ("network")],
+ )
+ def test_vagrant_root(temp_dir, scenario):
+ 
+diff --git a/molecule_vagrant/test/scenarios/molecule/network/converge.yml b/molecule_vagrant/test/scenarios/molecule/network/converge.yml
+new file mode 100644
+index 0000000..cd8ecfb
+--- /dev/null
++++ b/molecule_vagrant/test/scenarios/molecule/network/converge.yml
+@@ -0,0 +1,11 @@
++---
++- name: Converge
++  hosts: all
++  gather_facts: false
++  become: true
++  tasks:
++    - name: sample task  # noqa 305
++      shell:
++        cmd: uname
++        warn: false
++      changed_when: false
+diff --git a/molecule_vagrant/test/scenarios/molecule/network/molecule.yml b/molecule_vagrant/test/scenarios/molecule/network/molecule.yml
+new file mode 100644
+index 0000000..983fcc8
+--- /dev/null
++++ b/molecule_vagrant/test/scenarios/molecule/network/molecule.yml
+@@ -0,0 +1,23 @@
++---
++dependency:
++  name: galaxy
++driver:
++  name: vagrant
++  provider:
++    name: libvirt
++platforms:
++  - name: instance
++    box: ${TESTBOX:-centos/7}
++    provider_options:
++      driver: ${VIRT_DRIVER:-kvm}
++      # using session with network leads to troubles
++      qemu_use_session: false
++    provision: true
++    interfaces:
++      - network_name: private_network
++        type: dhcp
++        auto_config: true
++provisioner:
++  name: ansible
++verifier:
++  name: ansible
+diff --git a/molecule_vagrant/test/scenarios/molecule/network/verify.yml b/molecule_vagrant/test/scenarios/molecule/network/verify.yml
+new file mode 100644
+index 0000000..cc68b75
+--- /dev/null
++++ b/molecule_vagrant/test/scenarios/molecule/network/verify.yml
+@@ -0,0 +1,10 @@
++---
++- hosts: all
++  gather_facts: true
++  gather_subset:
++    - network
++  tasks:
++    - name: Check that there are 3 interfaces
++      assert:
++        that:
++          - "{{ ansible_interfaces | length == 3 }}"
+
+From c3ed4d5f0ee892651233b15c5b485d15ee539497 Mon Sep 17 00:00:00 2001
+From: Arnaud Patard <apatard at hupstream.com>
+Date: Sat, 15 May 2021 21:02:29 +0200
+Subject: [PATCH 2/2] molecule_vagrant/modules/vagrant.py: Fix network template
+
+In the changes introduced by the commit Vagrant yaml removal
+(0c1aed1fb550), the network definition in the jinja template
+got the loop iterator variable wrong. Use the right one.
+
+Fixes: #104
+
+Signed-off-by: Arnaud Patard <apatard at hupstream.com>
+---
+ molecule_vagrant/modules/vagrant.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/molecule_vagrant/modules/vagrant.py b/molecule_vagrant/modules/vagrant.py
+index 22f205d..532d11b 100644
+--- a/molecule_vagrant/modules/vagrant.py
++++ b/molecule_vagrant/modules/vagrant.py
+@@ -219,7 +219,7 @@
+     # Network
+     ##
+     {% for n in instance.networks %}
+-    c.vm.network "{{ network.name }}", {{ dict2args(network.options) }}
++    c.vm.network "{{ n.name }}", {{ dict2args(n.options) }}
+     {% endfor %}
+ 
+     ##

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-11-18 07:44:13 UTC (rev 1052061)
+++ PKGBUILD	2021-11-18 08:21:17 UTC (rev 1052062)
@@ -4,7 +4,7 @@
 pkgname=molecule-vagrant
 _module_name=molecule_vagrant
 pkgver=0.6.3
-pkgrel=1
+pkgrel=2
 pkgdesc="Molecule Vangrant Driver"
 arch=('any')
 url="https://github.com/ansible-community/molecule-vagrant"
@@ -12,12 +12,17 @@
 depends=('python' 'ansible' 'molecule' 'python-pyaml' 'python-vagrant')
 makedepends=('python-setuptools' 'python-setuptools-scm' 'molecule'
 'python-vagrant' 'python-pyaml' 'python-pip')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ansible-community/molecule-vagrant/archive/${pkgver}.tar.gz")
-sha512sums=('09165da30b6d678084760f8bf8ae552a5ece255b98e1cc86e76a9294bcbf720c951641208fad34d926ef3b1a97a0f65d181982ffed6f058413d2bf0846ea846e')
+source=(
+  "${pkgname}-${pkgver}.tar.gz::https://github.com/ansible-community/molecule-vagrant/archive/${pkgver}.tar.gz"
+  '105.patch'
+)
+sha512sums=('09165da30b6d678084760f8bf8ae552a5ece255b98e1cc86e76a9294bcbf720c951641208fad34d926ef3b1a97a0f65d181982ffed6f058413d2bf0846ea846e'
+            '566eca8d182b50658804b145d793eb4c9182c9499439f63a0a2bd94d13b1908ce084f25e5506f8690bdc7993b06384bf97df91ac5b3f0ea7a3042b328edb107d')
 
 prepare() {
   cd ${pkgname}-${pkgver}
   echo "Version: ${pkgver}" > PKG-INFO
+  patch -p1 -i "$srcdir/105.patch"
 }
 
 build() {



More information about the arch-commits mailing list