Пример #1
0
 def test_check_for_old_profiles_2(self, test_fix, inventory):
     """ pillar and bypass """
     test_fix = test_fix()
     inventory()
     dg.__pillar__ = dict(ceph=dict(storage='foo'))
     outp = dg.Output(filter_args=test_fix.filter_args, bypass_pillar=True)
     ret = outp._check_for_old_profiles()
     assert ret == ''
Пример #2
0
 def test_check_for_old_profiles_1(self, test_fix, inventory):
     """ pillar no bypass"""
     test_fix = test_fix()
     inventory()
     dg.__pillar__ = dict(ceph=dict(storage='foo'))
     ret = dg.Output(
         filter_args=test_fix.filter_args)._check_for_old_profiles()
     assert "You seem to have " in ret
Пример #3
0
 def test_check_for_old_profiles(self, test_fix, inventory):
     """ No pillar no bypass"""
     test_fix = test_fix()
     inventory()
     dg.__pillar__ = dict()
     ret = dg.Output(
         filter_args=test_fix.filter_args)._check_for_old_profiles()
     assert ret == ""
Пример #4
0
 def test_deploy_3(self, log, error_message, c_v_command, test_fix,
                   inventory):
     """ c_v_commands contains list of non-ceph-volume commands"""
     test_fix = test_fix()
     inventory()
     ret = dg.Output(filter_args=test_fix.filter_args).deploy()
     log.error.assert_called_with(c_v_command.return_value[0])
     assert ret == []
Пример #5
0
 def test_deploy_4(self, log, error_message, c_v_command, test_fix,
                   inventory):
     """ c_v_commands contains list of mixed-ceph-volume commands"""
     test_fix = test_fix()
     inventory()
     dg.__salt__ = dict()
     dg.__salt__['helper.run'] = Mock()
     ret = dg.Output(filter_args=test_fix.filter_args).deploy()
     log.error.assert_called_with(c_v_command.return_value[0])
     dg.__salt__['helper.run'].assert_called_with('ceph-volume lvm foo')
Пример #6
0
 def test_deploy_2(self, error_message, c_v_command, test_fix, inventory):
     """ c_v_commands contain a error dict """
     test_fix = test_fix()
     inventory()
     ret = dg.Output(filter_args=test_fix.filter_args).deploy()
     assert ret == c_v_command.return_value
Пример #7
0
 def test_deploy_1(self, error_message, c_v_command, test_fix, inventory):
     """ old_profiles detected, expect to return error_message"""
     test_fix = test_fix()
     inventory()
     ret = dg.Output(filter_args=test_fix.filter_args).deploy()
     assert ret == error_message.return_value