forked from openstack/rally
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
from rally.benchmark.scenarios import base | ||
from rally.plugins.openstack.scenarios.gbp import utils | ||
import time | ||
from rally.common import utils as rutils | ||
class GBPTests(utils.GBPScenario): | ||
"""Bechmark scenarios for Group Based Policy""" | ||
|
||
@base.scenario() | ||
def test_gbp(self, gbp_args=None): | ||
self._create_policy_action() | ||
action_name = rutils.generate_random_name(prefix="rally_action_allow_") | ||
self._create_policy_action(name=action_name) | ||
# Create a policy classifier | ||
self._create_policy_classifier("web-traffic","tcp", "80", "in") | ||
# Now create a policy rule | ||
self._create_policy_rule("web-policy-rule", "web-traffic", "allow") | ||
classifier_name = rutils.generate_random_name(prefix="rally_classifier_web_traffic_") | ||
self._create_policy_classifier(classifier_name,"tcp", "80", "in") | ||
# Now create a policy rule | ||
rule_name = rutils.generate_random_name(prefix="rally_rule_web_policy_") | ||
self._create_policy_rule(rule_name, classifier_name, action_name) | ||
# Now create a policy rule set | ||
self._create_policy_rule_set("web-ruleset", ["web-policy-rule"]) | ||
ruleset_name = rutils.generate_random_name(prefix="rally_ruleset_web_") | ||
self._create_policy_rule_set(ruleset_name, [rule_name]) | ||
# Now create a policy target group | ||
self._create_policy_target_group("web") | ||
pt_group_name = rutils.generate_random_name(prefix="rally_group_") | ||
self._create_policy_target_group(pt_group_name) | ||
# Now update the policy target group | ||
self._update_policy_target_group("web", provided_policy_rulesets=["web-ruleset"]) | ||
self._update_policy_target_group(pt_group_name, provided_policy_rulesets=[ruleset_name]) | ||
# Now create a policy target inside the group | ||
self._delete_policy_target_group("web") | ||
self._delete_policy_rule_set("web-ruleset") | ||
self._delete_policy_rule("web-policy-rule") | ||
self._delete_policy_classifier("web-traffic") | ||
self._delete_policy_action() | ||
pt_name = rutils.generate_random_name(prefix="rally_target_web1") | ||
self._create_policy_target(pt_name,pt_group_name) | ||
# Delete all created resources | ||
self._delete_policy_target(pt_name) | ||
self._delete_policy_target_group(pt_group_name) | ||
self._delete_policy_rule_set(ruleset_name) | ||
self._delete_policy_rule(rule_name) | ||
self._delete_policy_classifier(classifier_name) | ||
self._delete_policy_action(name=action_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters