Github user harikrishna-patnala commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/809#discussion_r39362992 --- Diff: test/integration/smoke/test_baremetal.py --- @@ -0,0 +1,155 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +""" Test for baremetal +""" +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.lib.utils import cleanup_resources, validateList +from marvin.lib.base import (Template, + Host, + ServiceOffering, + Account, + VirtualMachine) +from marvin.lib.common import get_domain, get_zone +from marvin.codes import PASS, HOSTTAG1 +from nose.plugins.attrib import attr + +#Import System modules +_multiprocess_shared_ = True + +class TestBaremetal(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + testClient = super(TestBaremetal, cls).getClsTestClient() + cls.apiclient = testClient.getApiClient() + cls.services = testClient.getParsedTestDataConfig() + # Get Zone, Domain + cls.domain = get_domain(cls.apiclient) + cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests()) + cls.services['mode'] = cls.zone.networktype + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.account = Account.create( + cls.apiclient, + cls.services["account"], + domainid=cls.domain.id + ) + #Register baremetal template + cls.template = Template.register( + cls.apiclient, + cls.services["baremetal_template"], + zoneid=cls.zone.id, + account=cls.account.name, + domainid=cls.account.domainid, + ) + cls.debug( + "Registered a template of format: %s with ID: %s" % ( + cls.services["baremetal_template"]["format"], cls.template.id + ) + ) + #Update host with host tag + cls.hosts = Host.list( + cls.apiclient, + zoneid=cls.zone.id, + hypervisor=cls.hypervisor + ) + if not validateList(cls.hosts)[0]: + assert False, "Invalid response for list host" + host_res = Host.update( --- End diff -- @sanju1010 I have checked the code and there seems a bug exists during vm deployment. Here you are setting the tag to Host using updateHostCmd which puts the host tag in "host_tags" table, but Baremetal planner searches for hosts with hosttag in "host_details" table. Can you please confirm or recheck whether baremetal instance provisioning is successful. If not we need to set the host tag while adding the host itself.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---