def test_pillar_install2(self): self.fs.create_file('/srv/pillar/top.sls', contents=''' base: '*': [] ''') self.assertFalse(PillarManager.pillar_installed()) PillarManager.install_pillar() self.assertTrue(PillarManager.pillar_installed()) self.fs.remove_object('/srv/pillar/top.sls')
def test_pillar_installed_top_without_ceph_salt(self): self.fs.create_file('/srv/pillar/top.sls', contents=''' base: '*': [] ''') self.assertFalse(PillarManager.pillar_installed()) self.fs.remove_object('/srv/pillar/top.sls')
def test_pillar_installed(self): self.fs.create_file('/srv/pillar/top.sls', contents=''' base: 'ceph-salt:member': [ceph-salt] ''') self.assertTrue(PillarManager.pillar_installed()) self.fs.remove_object('/srv/pillar/top.sls')
def test_pillar_installed_top_with_jinja2(self): self.fs.create_file('/srv/pillar/top.sls', contents=''' {% set x = 2 %}' base: 'ceph-salt:member': - ceph-salt ''') self.assertTrue(PillarManager.pillar_installed()) self.fs.remove_object('/srv/pillar/top.sls')
def test_pillar_installed(self): self.fs.create_file('/srv/pillar/top.sls', contents=''' base: {% include 'ceph-salt-top.sls' %} ''') self.fs.create_file( '/srv/pillar/ceph-salt-top.sls', contents='''{% import_yaml "ceph-salt.sls" as ceph_salt %} {% set ceph_salt_minions = ceph_salt.get('ceph-salt', {}).get('minions', {}).get('all', []) %} {% if ceph_salt_minions %} {{ ceph_salt_minions|join(',') }}: - match: list - ceph-salt {% endif %} ''') self.assertTrue(PillarManager.pillar_installed()) self.fs.remove_object('/srv/pillar/top.sls') self.fs.remove_object('/srv/pillar/ceph-salt-top.sls')
def test_pillar_install(self): self.fs.remove_object('/srv/pillar/ceph-salt.sls') self.assertFalse(PillarManager.pillar_installed()) PillarManager.install_pillar() self.assertTrue(PillarManager.pillar_installed())
def test_pillar_installed_top_with_jinja(self): self.fs.remove_object('/srv/pillar/ceph-salt.sls') self.fs.create_file('/srv/pillar/top.sls', contents='{% set x = 2 %}') self.assertFalse(PillarManager.pillar_installed()) self.fs.create_file('/srv/pillar/ceph-salt.sls') self.fs.remove_object('/srv/pillar/top.sls')
def test_pillar_installed_no_top2(self): self.assertFalse(PillarManager.pillar_installed())
def test_pillar_installed_no_top(self): self.fs.remove_object('/srv/pillar/ceph-salt.sls') self.assertFalse(PillarManager.pillar_installed()) self.fs.create_file('/srv/pillar/ceph-salt.sls')