Installing Ride on Pi Zero

Installing Ride v1.7.4 on Raspberry Pi Zero with Raspbian is a Challenge, especially during preperation and installation of wxPython for pi Zero

Base setup from pi Zero:

  • Rasbian buster lite
  • python 3.7

Do SW update before installing :

sudo apt-get update
sudo apt-get upgrade
sudo apt get dist-upgrade

Do Install pip3 for my pi zero:

sudo apt-get install python3-pip

Prepare installation before installing wxPython on pi Zero:

sudo apt-get install dpkg-dev build-essential swig python-dev libwebkit-dev libjpeg-dev libtiff-dev checkinstall freeglut3 freeglut3-dev libgtk2.0-dev  libsdl1.2-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgconf2-dev libglapi-mesa libosmesa6 libglu1-mesa-dev libglu1-mesa mesa-common-dev
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
sudo apt-get install python3.5-dev
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev

sudo apt-get install gtk+-3.0 gtk+3.0-dev
sudo pip3 install pathlib2

Now install wxPython, it can take long (+/- 24 Hours) by pi Zero!

sudo pip3 install wxPython

If it’t passed you can install wxPython with this Workarround!

sudo pip3 install --upgrade robotframework-ride==1.7.4b2

You can start the Ride now as remote sessions:

Ride.py &

Raspberry Pi & Robotframework

Raspberry Zero W connected directly to Mac with OTG mode

Why using Robotframework on Raspberry pi?

As Raspberry pi user , sometimes I have problems after doing OS update with some application I currently workout on pi, mean do “sudo apt-get update” , “sudo apt-get upgrade” & do “Reboot” everythings goes Wrong 🙁 !.

I have been using Robotframework since 2006, and would like to show you how simple to run a Regresion Test with Robotframework Framework on SBC like Rasberry Pi and Co’s. Robotframe work need only python ecosystem, which are out of the box delivered by Raspbian OS. And also it needs minimal resource of space in SD card.

As a sample I will start with installation of Robotframework , please check before if you have python pip installer installed on your Rasbian before starting with the installation!

Start Installation of Robotframework on Pi

sudo apt-get install python3-pip
sudo pip3 install robotframework
Installation run OK

Check Robotframework runner:

robot --version

Robotframework runner OK

You can used nano or Test IDE Ride for writing Tests .

Installing Robotframework-RIDE test IDE:

sudo pip3 install robotframework-ride

Start RIDE on Mac with ssh conection to pi:

ride.py & 

Running Robotframework-RIDE for testing Temperature Sensore Interface on Pi

now you can start writing your Test, please refer to Robotframework manual for more Information.

Let check the SD card used for Robotframework Installation, just 1% from 16 GB SD card!

Used pi space after Robotframework Installation

Wish you happy Testing and Try Out!

Testing Soap interface with Robotframework Library

For efficient testing sometime you need to created automaticaly request xml feeding soap interface. If you are familiar with robot framework, it’s great. Robotframework has already 2 external Library, which handle SOAP interfaces communication.( Süds Library or Zeep Library ) .

There are a lot of opinion in Internet about these two libraries, discussing pro and contra using one of these lib. for testing SOAP.

Important things to do, you have to find out which library can handle “your WSDL“ better!

For my task, Suds library does.

How to find it out?

Just run your SOAP Library keyword pointing out your target WSDL .

Used “Create Soap Client” keyword for testing the binding if you get all the entities and objects on your WSDL, If the answed “OK” than you can used your Library for SOAP,


Ports (1):
….
Methods (10):
addToIndex(xs:string guid, )
getProductMetadaten(xs:string guid, )
getProductMetadatenGuidList(xs:string query, )
getProductMetadatenList()

Types (62):
ns3:AbstractCurveType
ns3:AbstractGMLType
ns3:AbstractGeometricAggregateType
ns3:AbstractGeometricPrimitiveType

If not you have to find out other library for interfacing with SOAP.

As sample I got these error using Zeep for parsing my WSDL:

self.item_type = self.item_type.resolve()
AttributeError: ‘lxml.etree.QName’ object has no attribute ‘resolve’

These error are related to these following open issue on Zeep:

Sample of created XML request from RF with Suds Library:


XML Request Created with RF & SUD from input WSDL

this is how I wrote it in Robotframework Test Suite:

map WSDL local
Run Keyword and Continue On Failure setProductMetadaten

this is how I wrote it in Robotframework Test Case:

show object setProductMetadaten
setProductMetadaten

calling internal keyword:

${object}= Create WSDL Object n2:ProductMetadata
Set Wsdl Object Attribut ${object.commonMetadata} identifier ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata} title ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata.description} summary ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata.description} comments ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata.product} type ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata.product} subtype ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata} rflAuftragsnummer ${dummy_text}
Set Wsdl Object Attribut ${object.commonMetadata.change} version ${dummy_text}
${result}= call Soap method setProductMetadaten ${object}

RFlog result

RFlog result

Creating 100X Request with RF For loop keyword

map WSDL local
:FOR ${i} IN RANGE 100
setProductMetadaten

Hope these infos help you starting your SOAP request creation with Robotframework & SudsLibrary, just another way of SOAP testing than using SOAPUI.

Testing MS Software Rollout with Python ,WMI, and LDAP3

Most MS (Microsoft) software roll-out are release via SCCM to all Project Infrastructure (DC, AD, Application Servers, Application Clients). Usually testers are using Standards MS Tools like Powershell, MS CMD (tools: like netsh, wmic, etc) for validating Installation results on targets.

This article describe how the same tasks solve with python scripting using WMI & LDAP3 library.

Common Test Task & Rollout Workflow:

  1. Rollout related Packages will be distributed to MS SCCM
  2. Over SCCM Application GUI Testers trigger the release processes for target environment (Server/Client PC)
  3. On target environments testers mock up the sccm client update sequence to push roll-up update for related Packages.
  4. After SCCM agent invoke successfully SW update, the validation steps starting, Testers use common  MS OS GUI like “Software Information GUI” or “Service Information GUI ” for validating Installation status. Some Testers also used Powershell commands for Validating installations.

 Just daily tasks for MS Administrator , as test analyst , I try to find out more efficient way.

After  some investigation  I find out, the way validating MS SW status over WMI Interfaces are much easier than any Powershell or Dos Batch command, especially  with pywmi.  

These following WMI class Objects  are interesting for SW Installations
Validation :

  • Win32_OperatingSystem
  • Win32_Product
  • Win32_BaseService
  • Win32_Service
  • Win32_NTDomain
  • win32_optionalfeature
  • win32_ComputerSystem
  • Win32_PingStatus

Using pywmi, ldap3, winkerberos and common Excel library on python, I created scripts which extract the installed SW, Services Status, Drive Mapping , Domain configuration and AD Application User Accounts. All as excel files containing  Tabs related to the mentions check Topics.

Status, Drive Mapping , Domain configuration and AD Application User Accounts. All as excel files containing  Tabs related to the mentions check Topics

I Run it before SW update and after Update, find out the delta Information’s I got in my excel sheet and cross check if all Items match to release roll-out specifications.  

Added Value:

  • The script can be pointed for remote Target using WMI remote functionality.
  • Limited scripts to do only wmi-get  / LDAP show action (under executable) , to guaranties that no system or installation change cause by test action.
  • Validating more easier than with MS Scripting( I created “.exe” files for each test with py2exe)
  • I don’t mess any test object, because no installation for python needed (all checks are run as “.exe” files and can easily remove after test)

Ref: