Changeset - bc60f4771dd4
[Not reviewed]
0 2 2
Branko Majic (branko) - 4 years ago 2021-01-16 22:40:22
branko@majic.rs
MAR-151: Test removal of backports pin for lua-ldap (for Stretch -> Buster upgrades).
4 files changed with 43 insertions and 0 deletions:
0 comments (0 inline, 0 general)
roles/xmpp_server/molecule/default/files/lua_ldap_backports_pin
Show inline comments
 
new file 100644
 
#
 
# This file contains pinning information for deploying the backported
 
# version of lud-ldap that supports Lua 5.2 (for use with the Prosody
 
# XMPP server).
 
#
 

	
 
Package: lua-ldap
 
Pin: release a=buster-backports
 
Pin-Priority: 600
roles/xmpp_server/molecule/default/prepare.yml
Show inline comments
 
@@ -138,6 +138,14 @@
 
        mode: 0644
 
        state: present
 

	
 
    - name: Deploy lua-ldap package pin for testing Stretch -> Buster upgrade scenario (no need to pin the package in Buster)
 
      copy:
 
        src: "lua_ldap_backports_pin"
 
        dest: "/etc/apt/preferences.d/lua-ldap"
 
        owner: root
 
        group: root
 
        mode: 0644
 

	
 
- hosts: clients
 
  become: true
 
  tasks:
roles/xmpp_server/molecule/default/tests/test_default_buster.py
Show inline comments
 
new file 100644
 
import os
 

	
 
import testinfra.utils.ansible_runner
 

	
 

	
 
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
 
    os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('parameters-*-buster64')
 

	
 

	
 
def test_lua_ldap_pin_and_version(host):
 
    """
 
    Tests if lua-ldap package is not pinned to the backports
 
    repository.
 
    """
 

	
 
    pin_configuration_file = host.file("/etc/apt/preferences.d/lua-ldap")
 
    lua_ldap = host.package("lua-ldap")
 

	
 
    assert not pin_configuration_file.exists
 
    assert "bpo" not in lua_ldap.version
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -21,6 +21,12 @@
 
    mode: 0644
 
  when: "ansible_distribution_release == 'stretch'"
 

	
 
- name: Drop the Pin lua-ldap package (if machine was upgraded from Debian Stretch)
 
  file:
 
    path: "/etc/apt/preferences.d/lua-ldap"
 
    state: absent
 
  when: "ansible_distribution_release != 'stretch'"
 

	
 
- name: Add Prosody repository apt key
 
  apt_key:
 
    data: "{{ lookup('file', 'prosody-debian-packages.gpg') }}"
0 comments (0 inline, 0 general)