summaryrefslogtreecommitdiffstats
path: root/tests/lib/inspectors
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2018-01-10 09:42:05 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2018-01-10 09:42:05 +0800
commitf106c5a12724c684d747cf7f309f0ccc8b86cc61 (patch)
tree43ec5c5aebd19c9ce0838033f5821d89c93f4194 /tests/lib/inspectors
parent9fd701278bf7d8c5b9451491bcb1a92580adc780 (diff)
remove useless bash code
Change-Id: I530ef7fcdc4f9539517c5a2718e596f77de772a6 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/lib/inspectors')
-rw-r--r--tests/lib/inspectors/congress69
-rw-r--r--tests/lib/inspectors/sample18
2 files changed, 0 insertions, 87 deletions
diff --git a/tests/lib/inspectors/congress b/tests/lib/inspectors/congress
deleted file mode 100644
index 04825252..00000000
--- a/tests/lib/inspectors/congress
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-
-function _congress_add_rule {
- name=$1
- policy=$2
- rule=$3
-
- if ! openstack congress policy rule list $policy | grep -q -e "// Name: $name$" ; then
- openstack congress policy rule create --name $name $policy "$rule"
- fi
-}
-
-function _congress_del_rule {
- name=$1
- policy=$2
-
- if openstack congress policy rule list $policy | grep -q -e "^// Name: $name$" ; then
- openstack congress policy rule delete $policy $name
- fi
-}
-
-function _congress_add_rules {
- _congress_add_rule host_down classification \
- 'host_down(host) :-
- doctor:events(hostname=host, type="compute.host.down", status="down")'
-
- _congress_add_rule active_instance_in_host classification \
- 'active_instance_in_host(vmid, host) :-
- nova:servers(id=vmid, host_name=host, status="ACTIVE")'
-
- _congress_add_rule host_force_down classification \
- 'execute[nova:services.force_down(host, "nova-compute", "True")] :-
- host_down(host)'
-
- _congress_add_rule error_vm_states classification \
- 'execute[nova:servers.reset_state(vmid, "error")] :-
- host_down(host),
- active_instance_in_host(vmid, host)'
-}
-
-function start_inspector_congress {
- nova_api_min_version="2.11"
- nova_api_version=$(openstack congress datasource list | \
- grep nova | grep -Po "(?<='api_version': ')[^']*")
- [[ -z $nova_api_version ]] && nova_api_version="2.0"
- if [[ "$nova_api_version" < "$nova_api_min_version" ]]; then
- echo "ERROR: Congress Nova datasource API version < $nova_api_min_version ($nova_api_version)"
- exit 1
- fi
- openstack congress driver list | grep -q " doctor "
- openstack congress datasource list | grep -q " doctor " || {
- openstack congress datasource create doctor doctor
- }
- _congress_add_rules
-
-}
-
-function stop_inspector_congress {
- _congress_del_rule host_force_down classification
- _congress_del_rule error_vm_states classification
- _congress_del_rule active_instance_in_host classification
- _congress_del_rule host_down classification
-
-}
-
-function cleanup_inspector_congress {
- # Noop
- return
-}
diff --git a/tests/lib/inspectors/sample b/tests/lib/inspectors/sample
deleted file mode 100644
index 75d5c022..00000000
--- a/tests/lib/inspectors/sample
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-INSPECTOR_PORT=${INSPECTOR_PORT:-12345}
-
-function start_inspector_sample {
- pgrep -f "python inspector.py" && return 0
- python inspector.py "$INSPECTOR_PORT" > inspector.log 2>&1 &
-}
-
-function stop_inspector_sample {
- pgrep -f "python inspector.py" || return 0
- kill $(pgrep -f "python inspector.py")
-}
-
-function cleanup_inspector_sample {
- # Noop
- return
-}