コード例 #1
0
ファイル: load_hvm_image.py プロジェクト: datatonic/nephoria
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
from nephoria.testcase_utils.eutestcase import EutesterTestCase
from imageutils import ImageUtils

machine=None
testcase = EutesterTestCase()

testcase.setup_parser(testname='load_hvm_image.py',
                      description='Loads an hvm image from either a remote url or local file path',
                      emi=False,
                      testlist=False)

testcase.parser.add_argument('--url',help='URL containing remote windows image '
                                          'to create EMI from', default=None)
testcase.parser.add_argument('--filepath',dest='filepath', help='File path to create EMI from', default=None)
testcase.parser.add_argument('--workerip',dest='worker_machine', help='The ip/hostname of the machine that the operation will be performed on', default=None)
testcase.parser.add_argument('--worker_username',dest='worker_username', help='The username of the machine that the operation will be performed on, default:"root"', default='root')
testcase.parser.add_argument('--worker_password',dest='worker_password', help='The password of the machine that the operation will be performed on', default=None)
testcase.parser.add_argument('--worker_keypath',dest='worker_keypath', help='The ssh keypath of the machine that the operation will be performed on', default=None)
testcase.parser.add_argument('--destpath',help='The path on the workip, that this operation will be performed on', default='/disk1/storage')
testcase.parser.add_argument('--urlpass', dest='wget_password',help='Password needed to retrieve remote url', default=None)
コード例 #2
0
from nephoria.testcase_utils.eutestcase import EutesterTestCase, SkipTestException
from cloud_utils.net_utils.sshconnection import SshConnection

##################################################################################################
# Create the testcase object                                                                     #
##################################################################################################
testcase = EutesterTestCase()

##################################################################################################
# See 'setup_parser' for all the default cli arguments. These can be negated by setting          #
# these to 'false' as shown here...                                                              #
##################################################################################################
testcase.setup_parser(testname='My first test',
                      description='Sample testcase',
                      emi=False, # exclude the emi cli option from this test
                      testlist=False # Exclude the 'testlist' cli option for this test
                      )

##################################################################################################
# Add an additional CLI argument to this test                                                    #
##################################################################################################
testcase.parser.add_argument('--test_ip',
                             help='IP address used to create SSH connection sample test',
                             default=None)

##################################################################################################
# Gather CLI arguments, this will also parse any arguments in any config files                   #
# that are provided. The cli args and config file args will be merged into testcase.args         #
##################################################################################################
testcase.get_args()