Fix path to plugin

Adding full path for plugin creation

Change-Id: Ife31ee10a76368405859e0f7041e1e1008301be6
Closes-Bug: #1508527
This commit is contained in:
Egor Kotko 2015-10-28 17:11:24 +01:00 committed by tatyana-leontovich
parent 4d226403bd
commit 33d0ce8673
2 changed files with 29 additions and 26 deletions

View File

@ -53,6 +53,7 @@ class RebootPlugin(TestBasic):
"""
# define some plugin related variables
plugin_name = 'reboot_plugin'
container_plugin_path = os.path.join('/root/', plugin_name)
plugin_path = '/var'
tasks_path = os.path.dirname(os.path.abspath(__file__))
tasks_file = 'reboot_tasks.yaml'
@ -65,13 +66,13 @@ class RebootPlugin(TestBasic):
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
fpb.fpb_create_plugin(plugin_name)
fpb.fpb_create_plugin(container_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join(tasks_path, tasks_file),
os.path.join('/root/', plugin_name, 'tasks.yaml'))
# build plugin
fpb.fpb_build_plugin(os.path.join('/root/', plugin_name))
fpb.fpb_build_plugin(container_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin_from_container(plugin_name, plugin_path)
@ -177,6 +178,7 @@ class RebootPlugin(TestBasic):
"""
# define some plugin related variables
plugin_name = 'timeout_plugin'
container_plugin_path = os.path.join('/root/', plugin_name)
plugin_path = '/var'
tasks_path = os.path.dirname(os.path.abspath(__file__))
tasks_file = 'reboot_tasks.yaml'
@ -194,14 +196,14 @@ class RebootPlugin(TestBasic):
[1, 'parameters', 'timeout'],
1)
# create plugin template on the master node
fpb.fpb_create_plugin(plugin_name)
fpb.fpb_create_plugin(container_plugin_path)
# replace plugin tasks with our file
fpb.fpb_replace_plugin_content(
os.path.join('/tmp/', tasks_file),
os.path.join('/root/', plugin_name, 'tasks.yaml')
os.path.join(container_plugin_path, 'tasks.yaml')
)
# build plugin
fpb.fpb_build_plugin(os.path.join('/root/', plugin_name))
fpb.fpb_build_plugin(container_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin_from_container(plugin_name, plugin_path)

View File

@ -53,6 +53,7 @@ class VipReservation(TestBasic):
Duration 40m
"""
plugin_name = 'vip_reservation_plugin'
container_plugin_path = os.path.join('/root/', plugin_name)
plugin_path = '/var'
dir_path = os.path.dirname(os.path.abspath(__file__))
tasks_file = 'tasks.yaml'
@ -67,19 +68,19 @@ class VipReservation(TestBasic):
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
fpb.fpb_create_plugin(plugin_name)
fpb.fpb_create_plugin(container_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, net_role_file),
os.path.join('/root/', plugin_name, net_role_file))
os.path.join(container_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, tasks_file),
os.path.join('/root/', plugin_name, tasks_file))
os.path.join(container_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(dir_path, metadata_file),
os.path.join('/root/', plugin_name, metadata_file))
os.path.join(container_plugin_path, metadata_file))
# build plugin
fpb.fpb_build_plugin(os.path.join('/root/', plugin_name))
fpb.fpb_build_plugin(container_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin_from_container(plugin_name, plugin_path)
@ -171,6 +172,7 @@ class VipReservation(TestBasic):
Duration 40m
"""
plugin_name = 'vip_reservation_plugin'
container_plugin_path = os.path.join('/root/', plugin_name)
plugin_path = '/var'
task_path = os.path.dirname(os.path.abspath(__file__))
tasks_file = 'tasks.yaml'
@ -186,29 +188,28 @@ class VipReservation(TestBasic):
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
fpb.fpb_create_plugin(plugin_name)
fpb.fpb_create_plugin(container_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join('/root/', plugin_name, net_role_file))
os.path.join(container_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join('/root/', plugin_name, tasks_file))
os.path.join(container_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join('/root/', plugin_name, metadata_file))
os.path.join(container_plugin_path, metadata_file))
fpb.change_yaml_file_in_container(
os.path.join('/root/', plugin_name, net_role_file),
os.path.join(container_plugin_path, net_role_file),
[0, 'properties', 'vip', 0, 'namespace'],
namespace)
fpb.change_yaml_file_in_container(
os.path.join('/root/', plugin_name, net_role_file),
os.path.join(container_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
fpb.fpb_build_plugin(os.path.join('/root/', plugin_name))
fpb.fpb_build_plugin(container_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin_from_container(plugin_name, plugin_path)
@ -297,6 +298,7 @@ class VipReservation(TestBasic):
Duration 40m
"""
plugin_name = 'vip_reservation_plugin'
container_plugin_path = os.path.join('/root/', plugin_name)
plugin_path = '/var'
task_path = os.path.dirname(os.path.abspath(__file__))
tasks_file = 'tasks.yaml'
@ -312,29 +314,28 @@ class VipReservation(TestBasic):
# install fuel_plugin_builder on master node
fpb.fpb_install()
# create plugin template on the master node
fpb.fpb_create_plugin(plugin_name)
fpb.fpb_create_plugin(container_plugin_path)
# replace plugin tasks, metadata, network_roles
fpb.fpb_replace_plugin_content(
os.path.join(task_path, net_role_file),
os.path.join('/root/', plugin_name, net_role_file))
os.path.join(container_plugin_path, net_role_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, tasks_file),
os.path.join('/root/', plugin_name, tasks_file))
os.path.join(container_plugin_path, tasks_file))
fpb.fpb_replace_plugin_content(
os.path.join(task_path, metadata_file),
os.path.join('/root/', plugin_name, metadata_file))
os.path.join(container_plugin_path, metadata_file))
fpb.change_yaml_file_in_container(
os.path.join('/root/', plugin_name, net_role_file),
os.path.join(container_plugin_path, net_role_file),
[0, 'properties', 'vip', 0, 'namespace'],
namespace)
fpb.change_yaml_file_in_container(
os.path.join('/root/', plugin_name, net_role_file),
os.path.join(container_plugin_path, net_role_file),
[1, 'properties', 'vip', 0, 'namespace'],
namespace)
# build plugin
fpb.fpb_build_plugin(os.path.join('/root/', plugin_name))
fpb.fpb_build_plugin(container_plugin_path)
# copy plugin archive file from nailgun container
# to the /var directory on the master node
fpb.fpb_copy_plugin_from_container(plugin_name, plugin_path)