1 ##############################################################################
2 # Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
12 from yardstick.benchmark.scenarios.availability.attacker import baseattacker
15 class BaseAttackerTestCase(unittest.TestCase):
19 'fault_type': 'test-attacker',
20 'action_parameter': {'process_name': 'nova_api'},
21 'rollback_parameter': {'process_name': 'nova_api'},
22 'key': 'stop-service',
23 'attack_key': 'stop-service',
26 self.base_attacker = baseattacker.BaseAttacker({}, {})
28 def test__init__(self):
29 self.assertEqual(self.base_attacker.data, {})
30 self.assertFalse(self.base_attacker.mandatory)
31 self.assertEqual(self.base_attacker.intermediate_variables, {})
32 self.assertFalse(self.base_attacker.mandatory)
34 def test_get_attacker_cls(self):
35 with self.assertRaises(RuntimeError):
36 baseattacker.BaseAttacker.get_attacker_cls(self.attacker_cfg)