Add simple fake plugin for testing

We need to have fake plugin to perform provisioning testing in gate.

Partially Implements: blueprint fake-test-plugin

Change-Id: I112ca08462f3a0a9847e16deba6d8535182a28d6
This commit is contained in:
Sergey Lukjanov 2014-04-24 14:31:00 +04:00
parent e565c40ea4
commit 843ffcfa7d
3 changed files with 49 additions and 0 deletions

View File

View File

@ -0,0 +1,48 @@
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara.plugins import provisioning as p
class FakePluginProvider(p.ProvisioningPluginBase):
def get_title(self):
return "Fake Plugin"
def get_description(self):
return ("It's a fake plugin that aimed to work on the CirrOS images. "
"It doesn't install Hadoop. It's needed to be able to test "
"provisioning part of Sahara codebase itself.")
def get_versions(self):
return ["0.1"]
def get_node_processes(self, hadoop_version):
return {
"HDFS": ["namenode", "datanode"],
"MapReduce": ["tasktracker", "jobtracker"],
}
def get_configs(self, hadoop_version):
# no need to expose any configs, it could be checked using real plugins
return []
def configure_cluster(self, cluster):
# noop
pass
def start_cluster(self, cluster):
# noop
pass

View File

@ -36,6 +36,7 @@ console_scripts =
sahara.cluster.plugins = sahara.cluster.plugins =
vanilla = sahara.plugins.vanilla.plugin:VanillaProvider vanilla = sahara.plugins.vanilla.plugin:VanillaProvider
hdp = sahara.plugins.hdp.ambariplugin:AmbariPlugin hdp = sahara.plugins.hdp.ambariplugin:AmbariPlugin
fake = sahara.plugins.fake.plugin:FakePluginProvider
sahara.infrastructure.engine = sahara.infrastructure.engine =
direct = sahara.service.direct_engine:DirectEngine direct = sahara.service.direct_engine:DirectEngine