added image upload

Change-Id: I4e452951ddfa36a31a1a4a5cc96790fc1b2698fc
This commit is contained in:
Volodymyr Rozhanskyy 2016-08-17 17:52:09 +03:00
parent a18817fb47
commit fed80cf2db
4 changed files with 88 additions and 23 deletions

View File

@ -13,12 +13,16 @@ License for the specific language governing permissions and limitations
under the License.
"""
import traceback
import os
from fuelweb_test.helpers import utils
from proboscis.asserts import assert_true
from fuelweb_test.helpers import utils
from fuelweb_test import logger
from fuelweb_test.helpers.ssh_manager import SSHManager
from settings import MANILA_IMAGE_PATH
from settings import MANILA_PLUGIN_PATH
from settings import plugin_name
@ -29,6 +33,7 @@ msg = "Plugin couldn't be enabled. Check plugin version. Test aborted"
def install_manila_plugin(master_node_ip):
"""Install plugin packages to the master node."""
utils.upload_tarball(
master_node_ip,
MANILA_PLUGIN_PATH, "/var")
@ -37,6 +42,33 @@ def install_manila_plugin(master_node_ip):
os.path.basename(MANILA_PLUGIN_PATH))
def upload_manila_image(master_node_ip, image_dest_path):
"""Copy Manila qcow2 image to the master node.
:type master_node_ip: string master-node ip
:type image_dest_path: string destination path
"""
logger.info(image_dest_path)
try:
logger.info("Start to upload manila image file")
SSHManager().upload_to_remote(
ip=master_node_ip,
source=MANILA_IMAGE_PATH,
target=image_dest_path
)
manila_image_name = MANILA_IMAGE_PATH.split('/')
dest_path = '{0}/{1}'.format(
image_dest_path, manila_image_name[-1])
logger.info('File {} was uploaded on master'.format(dest_path))
return dest_path
except:
logger.error('Failed to upload file')
logger.error(traceback.format_exc())
return False
def enable_plugin_manila(cluster_id, fuel_web_client):
"""Enable Manila plugin on cluster."""
assert_true(

View File

@ -17,4 +17,6 @@ under the License.
import os
MANILA_PLUGIN_VERSION = os.environ.get('MANILA_PLUGIN_VERSION')
MANILA_PLUGIN_PATH = os.environ.get('MANILA_PLUGIN_PATH')
MANILA_IMAGE_PATH = os.environ.get('MANILA_IMAGE_PATH')
plugin_name = 'fuel-plugin-manila'

View File

@ -139,7 +139,7 @@ class TestManilaSmoke(TestBasic):
"""Check deployment with Manila plugin and one controller.
Scenario:
1. Upload plugins to the master node
1. Upload plugins to the master node + upload Manila_Image
2. Install plugin.
3. Create a new environment with following parameters:
* Compute: KVM/QEMU
@ -148,14 +148,14 @@ class TestManilaSmoke(TestBasic):
* Additional services: default
4. Add nodes with following roles:
* Controller
* Compute
* Cinder
* Compute + Cinder
5. Configure interfaces on nodes.
6. Configure network settings.
7. Enable and configure Manila plugin.
8. Verify networks.
9. Deploy the cluster.
Duration: 1.8 hour
10. Run OSTF.
Duration: 2.0 hour
"""
self.env.revert_snapshot("ready_with_3_slaves")
@ -163,6 +163,22 @@ class TestManilaSmoke(TestBasic):
self.show_step(2)
plugin.install_manila_plugin(self.ssh_manager.admin_ip)
# upload manila image to master node
path = "/var/www/nailgun/plugins/fuel-plugin-manila-1.0/repositories" \
"/ubuntu"
manila_image = plugin.upload_manila_image(
self.ssh_manager.admin_ip,
path
)
print manila_image
assert_true(
manila_image,
"Upload of manila image to master node fail"
)
self.show_step(3)
# Configure new cluster
cluster_id = self.fuel_web.create_cluster(
@ -178,8 +194,8 @@ class TestManilaSmoke(TestBasic):
self.fuel_web.update_nodes(
cluster_id,
{'slave-01': ['controller'],
'slave-02': ['compute'],
'slave-03': ['cinder']
'slave-02': ['compute', 'cinder'],
'slave-03': ['base-os']
}
)
@ -195,14 +211,19 @@ class TestManilaSmoke(TestBasic):
self.show_step(9)
self.fuel_web.deploy_cluster_wait(cluster_id)
self.show_step(10)
self.fuel_web.run_ostf(
cluster_id=cluster_id, test_sets=['smoke', 'sanity'])
self.env.make_snapshot("manilla_install", is_make=True)
@test(depends_on=[SetupEnvironment.prepare_slaves_5],
groups=["manila_bvt"])
@log_snapshot_after_test
def manila_bvt(self):
"""Check deployment with Manila plugin and one controller.
""""Check deployment with Manila plugin and one controller.
Scenario:
1. Upload plugins to the master node
1. Upload plugins to the master node + upload Manila_Image
2. Install plugin.
3. Create a new environment HA with following parameters:
* Compute: KVM/QEMU
@ -210,11 +231,11 @@ class TestManilaSmoke(TestBasic):
* Storage: Cepth
* Additional services: default
4. Add nodes with following roles:
* Controller + Cinder
* Controller + Cinder
* Controller + Cinder
* Compute
* Compute
* Controller
* Controller
* Controller
* Compute + Cinder
* Compute + Cinder
5. Configure interfaces on nodes.
6. Configure network settings.
7. Enable and configure Manila plugin.
@ -225,10 +246,21 @@ class TestManilaSmoke(TestBasic):
"""
self.env.revert_snapshot("ready_with_5_slaves")
self.show_step(1)
self.show_step(2)
plugin.install_manila_plugin(self.ssh_manager.admin_ip)
# upload manila image to master node
path = "/var/www/nailgun/plugins/fuel-plugin-manila-1.0/repositories" \
"/ubuntu"
manila_image = plugin.upload_manila_image(
self.ssh_manager.admin_ip,
path
)
print manila_image
assert_true(
manila_image,
"Upload of manila image to master node fail"
)
self.show_step(3)
# Configure new cluster
@ -240,15 +272,16 @@ class TestManilaSmoke(TestBasic):
"net_segment_type": NEUTRON_SEGMENT_TYPE
}
)
self.show_step(4)
# Assign role to node
self.fuel_web.update_nodes(
cluster_id,
{'slave-01': ['controller', 'cinder'],
'slave-02': ['controller', 'cinder'],
'slave-03': ['controller', 'cinder'],
'slave-04': ['compute'],
'slave-05': ['compute']
{'slave-01': ['controller'],
'slave-02': ['controller'],
'slave-03': ['controller'],
'slave-04': ['compute', 'cinder'],
'slave-05': ['compute', 'cinder']
}
)

View File

@ -31,8 +31,6 @@ if [ -z "$ADMIN_NODE_CPU" ]; then export ADMIN_NODE_CPU=4; fi
if [ -z "$SLAVE_NODE_MEMORY" ]; then export SLAVE_NODE_MEMORY=4096; fi
if [ -z "$SLAVE_NODE_CPU" ]; then export SLAVE_NODE_CPU=4; fi
# Init and update submodule
git submodule update --init --recursive --remote
sudo /sbin/iptables -F
sudo /sbin/iptables -t nat -F