Testing Providers with PyWBEM

Similar documents
Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5

PROFESSIONAL. Node.js BUILDING JAVASCRIPT-BASED SCALABLE SOFTWARE. Pedro Teixeira WILEY. John Wiley & Sons, Inc.

CIM Operations over HTTP

OpenWBEM Getting Started Guide. Author: Dan Nuffer Last update: 12/09/04

Survey of Unit-Testing Frameworks. by John Szakmeister and Tim Woods

Project #4: MITM Attacks and Authentication

latest Release 0.2.6

1. Stem. Configuration and Use of Stem

Integrating HP Insight Management WBEM (WMI) Providers for Windows with HP System Insight Manager

70-536VB:.NET Framework Application Development Foundation Course Introduction

Apache Thrift and Ruby

smtplib SMTP protocol client

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

Getting Started with the Internet Communications Engine

Open Pegasus Part 1 Overview and Update

MS Enterprise Library 5.0 (Logging Application Block)

A Survey of Open Source Solutions In the CIM Environment. 11 October 2007

Quartz.Net Scheduler in Depth

shodan-python Documentation

socketio Documentation

Getting Started Guide with WIZ550web

Visual Basic. murach's TRAINING & REFERENCE

C#5.0 IN A NUTSHELL. Joseph O'REILLY. Albahari and Ben Albahari. Fifth Edition. Tokyo. Sebastopol. Beijing. Cambridge. Koln.

Application Note 49. Using the Digi TransPort Fleet Card. October 2011

Release Notes LS Retail Data Director August 2011

Integration of Nagios monitoring tools with IBM's solutions

Monitoring, Tracing, Debugging (Under Construction)

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

orrelog SNMP Trap Monitor Software Users Manual

Storage Health and Event Monitoring

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

HP Device Manager 4.6

HP Operations Orchestration Software

Discovery Guide. Secret Server. Table of Contents

Realization of Inventory Databases and Object-Relational Mapping for the Common Information Model

Unit testing with mock code EuroPython 2004 Stefan Schwarzer p.1/25

Tutorial. Reference for more thorough Mininet walkthrough if desired

Android, Bluetooth and MIAC

Monitoring Windows Servers and Applications with GroundWork Monitor Enterprise 6.7. Product Application Guide October 8, 2012

Certified The Grinder Testing Professional VS-1165

This section provides a 'Quickstart' guide to using TestDriven.NET any version of Microsoft Visual Studio.NET

Test Automation Integration with Test Management QAComplete

CoreLib Documentation

Oracle Exam 1z0-102 Oracle Weblogic Server 11g: System Administration I Version: 9.0 [ Total Questions: 111 ]

In: Proceedings of RECPAD th Portuguese Conference on Pattern Recognition June 27th- 28th, 2002 Aveiro, Portugal

Wakanda Studio Features

GSX Monitor & Analyzer. for IBM Collaboration Suite

Tivoli Directory Server v6.3 Part03 of 06 Backup and Recovery

PHP on IBM i: What s New with Zend Server 5 for IBM i

StreamServe Persuasion SP4 Service Broker

UltraFlow -Cisco Netflow tools-

openssl egg Bindings to the OpenSSL SSL/TLS library Extension for Chicken Scheme Version Thomas Chust

Real-time Device Monitoring Using AWS

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

HP Data Protector Integration with Autonomy IDOL Server

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

BI xpress Product Overview

PCD Test Tools. These tools provide various test functions for the Power Chain Device Toolkit web services (BACnetWS+).

Features of The Grinder 3

How to analyse your system to optimise performance and throughput in IIBv9

Main Bullet #1 Main Bullet #2 Main Bullet #3

Demo: Controlling.NET Windows Forms from a Java Application. Version 7.3

MatrixSSL Getting Started

Enhanced Project Management for Embedded C/C++ Programming using Software Components

HP Server Automation. Software Versions: 7.8x, 9.0x, 9.1x. Software Discovery Reference Guide

SimWebLink.NET Remote Control and Monitoring in the Simulink

Tcl and Cloud Computing Automation

Bernd Ahlers Michael Friedrich. Log Monitoring Simplified Get the best out of Graylog2 & Icinga 2

How To Set Up A Network Map In Linux On A Ubuntu 2.5 (Amd64) On A Raspberry Mobi) On An Ubuntu (Amd66) On Ubuntu 4.5 On A Windows Box

NRPE Documentation CONTENTS. 1. Introduction... a) Purpose... b) Design Overview Example Uses... a) Direct Checks... b) Indirect Checks...

Syslog Monitoring Feature Pack

IHS USER SECURITY AUDIT

CIM SMASH/Server Management API Programming Guide ESX 4.1 ESXi 4.1

Installing Bacula Client on Mac OS X Server

Using LDAP Authentication in a PowerCenter Domain

A Native Client for the Hadoop Distributed Filesystem by Colin P. McCabe

TECHNICAL NOTE TNOI27

Microsoft Windows PowerShell v2 For Administrators

HP WBEM Services Software Developer s Kit, Version A.02.00, Release Notes

HP ProLiant Essentials Vulnerability and Patch Management Pack Planning Guide

Novell Identity Manager

Open source framework for interactive data exploration in server based architecture

Integration and Configuration of SofwareAG s webmethods Broker with JBOSS EAP 6.1

This presentation explains how to monitor memory consumption of DataStage processes during run time.

Managing Servers in the Enterprise

Quick Connect Express for Active Directory

HP WBEM Services Software Developer's Kit Version A Release Notes. HP-UX 11i v3

Management, Logging and Troubleshooting

Windows PowerShell Cookbook

Configuring System Message Logging

Performance Testing for Ajax Applications

This presentation will discuss how to troubleshoot different types of project creation issues with Information Server DataStage version 8.

3DHOP Local Setup. Lezione 14 Maggio 2015

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7/v1.8

Technical. Overview. ~ a ~ irods version 4.x

Forming a P2P System In order to form a P2P system, the 'central-server' should be created by the following command.

William E. Hart Carl Laird Jean-Paul Watson David L. Woodruff. Pyomo Optimization. Modeling in Python. ^ Springer

Transcription:

Testing Providers with PyWBEM Tim Potter <tpot@hp.com> Hewlett-Packard 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice

Overview PyWBEM basics Exploring with wbemcli.py Unit testing with unittest module Async client programming with Twisted Using the MOF compiler Presentation materials available at http://samba.org/~tpot/mdc2008 2 18 November 2008

PyWBEM overview A pure-python library for WBEM Sync and async CIM-XML client Provider interface MOF compiler Command line client Uses Python language features to provide easy to use interfaces for WBEM 3 18 November 2008

Getting started Install PyWBEM Available in some distros http://pywbem.sourceforge.net Create connection WBEMConnection() for CIM-XML over http/https {Pegasus,OpenWBEM,SFCB}UDSConnection() for unix domain socket access Use connection object to perform operations and return other PyWBEM objects 4 18 November 2008

pywbem.ciminstancename Represents an object path/model path Attributes host classname namespace keybindings Use Python object attributes and dictionary interface 5 18 November 2008

pywbem.ciminstance Represents an instance of a class Attributes host classname namespace path (is a CIMInstanceName) properties Use Python object attributes and dictionary interface 6 18 November 2008

Error handling Python exception is thrown when a CIM error occurs try: cli.enumerateinstances('cim_foo') except pywbem.cimerror, arg: error = arg[0] # error number description = arg[1] # string Error constants available, e.g CIM_ERR_FAILED 7 18 November 2008

Other useful objects CIMClass classname properties, methods, qualifiers CIMDateTime Wrapper for datetime.{datetime,timedelta} CIM numeric types SintXX, UintXX, RealXX CIMQualifier name, value, type 8 18 November 2008

Demo #1 and #2 Making connections Performing simple WBEM operations Accessing CIM object attributes 9 18 November 2008

Testing Instance Providers EnumerateInstanceNames(ClassName) List of CIMInstanceName EnumerateInstances(ClassName) List of CIMInstance GetInstance(InstanceName) List of CIMInstance ModifyInstance(Instance) None DeleteInstance(InstanceName) None CreateInstance(Instance) CIMInstanceName 10 18 November 2008

Testing Association Providers AssociatorNames(InstanceName, Args...) List of CIMInstanceName Associators(InstanceName, Args...) List of CIMInstance ReferenceNames(InstanceName, Args...) List of CIMInstanceName References(InstanceName, Args...) List of CIMInstance Arguments are ResultClass, Role, AssociationClass, etc... 11 18 November 2008

Testing Method Providers InvokeMethod(MethodName, InstanceName, InParams) Tuple of method result and output parameters Result, OutParams = cli.invokemethod( 'SetPowerState', cs, PowerState = pywbem.uint32(8), Time = datetime.now()) 12 18 November 2008

wbemcli.py Command line tool for exploration and ad-hoc testing Connects to a WBEM server then drops into Python interactive interpreter Lots of extra goodies to make life easier for testing and debugging 13 18 November 2008

wbemcli.py (cont) Usage: wbemcli.py HOST [ u USER] [ p PASS] \ [ n NAMESPACE] [ no ssl] [ port PORT] Features Uses full power of Python interactive interpreter Saves command line history to disk Aliases for common WBEM operations Pretty print of long results 14 18 November 2008

Demo #3 Using wbemcli.py for ad-hoc testing 15 18 November 2008

Unit testing with unittest.py Built-in unit testing module using xunit interface setup(), runtest(), teardown() Test fixtures created for each test case Python version clunky but still usable Can run tests individually By named test case By named test method 16 18 November 2008

Demo #4 Running unit tests based on Python's unittest.py module 17 18 November 2008

Asynchronous client programming Uses Twisted Python networking framework Event driven programming model no threads reactor is central object in a Twisted program Uses callback model to respond to events defered is central object for using callbacks Go read tutorial and reference documentation at http://twistedmatrix.com 18 18 November 2008

Using the PyWBEM Twisted Client Basic process for performing a client operation: 1. Create a factory which creates instances of the operation you want to perform 2. Add callbacks 3. Call reactor.connecttcp() 4. Enter or return to event loop Return deferred objects to hang callbacks off A deferred is a promise that a function will at some point have a result. 19 18 November 2008

Example: Create CIM_Indication filter CIM operations, twisted style Create CIMInstance object Create a CreateInstance factory Add success and failure callbacks Make TCP client connection Enter event loop Trigger subsequent operations off callbacks 20 18 November 2008

Creating a CIM Listener Basic process for listening for indications Create a twisted.web.server listening on port 5988 and port 5989 Create a twisted.web.resource to handle POST requests and parse received XML Call reactor.listentcp() function or reactor.listenssl() See irecv.py file in PyWBEM distribution Can have CIM client and server in same process 21 18 November 2008

Using PyWBEM MOF Compiler Define a class with a PyWBEM server interface CreateClass, ModifyClass, EnumerateQualifiers, etc Create a mof_compiler.mofcompiler instance Call compile_file() for each MOF file to process 22 18 November 2008

Tricks & Traps Use DeepInheritance = True when enumerating classes and class names Use LocalOnly = False when calling GetClass() method Watch out for host attribute in return values from associators May need to set to None 23 18 November 2008

24 18 November 2008