Robot Framework User Guide. Bootstrapped

rfw_main2

Eight years ago when I graduated from the University my first job title was a QA Engineer. Lots have been changed since then, but these days I am once again facing some QA tasks. Gladly this time we are talking Test Automation.

In particular my team mates and myself are going to develop a set of test cases to automate acceptance and regressions testing for Nuage VSP products. For many reasons for this task we chose Robot Framework as a tool to write our test cases. Without going into the details about what are the benefits of Robot let me jump to the very point of this post.

Robot has one of the most comprehensive User Guides I’ve seen in Opensource world. It is well-written, descriptive, with lots of examples, but… But it lacks of modern formatting. It is hard to read the docs on a wide monitors, impossible to read on tablets/phones, code snippets have been formatted in too narrow elements and other visual stuff that prevents one to enjoy the documentation itself in full flavor.

Given that I made a humble attempt to beautify the official User Guide of Robot by going the same way as I did with NokDoc — namely, using the Bootstrap CSS and automatically rebuild the docs with it.

Please meet rfug.github.io (rfug stands for robot framework user guide).

What has been changed?

  1. Layout now responsive, meaning it will adapt to your device resolution. You may enjoy RF User Guide on portable devices
  2. Open Sans font is enabled by default
  3. Tables are now 100% wide and with a cleaner look

PDF version

I have also compiled a PDF version of the Bootstrapped User Guide. It has the same nice styles applied as well as Table Of Contents, so you will have the ability to navigate through the document quick & easy.

What could be added?

  1. I still have some things to fugure out how to make the page layout be more usable on small resolutions (phones)
  2. Sidebar with all the table of contents links

How it’s been done?

I wrote a small html parser powered by BeautifulSoup4 package to add/change the elements in original User Guide. And I uploaded it to the free HTML server of github (namely github pages).

 

Read More...

NokDoc Library & NokDoc CLI Tool

featured

For many years Alcatel-Lucent’s documentation was all about authorized personnel only. All of it. And not so long ago ALU opened a considerable part of its documentation portfolio to everyone via its support portal!

This portal internally is the same support portal available at alcatel-lucent.com domain though styles are now aligned with Nokia brand-kit. And being the same means that it is often slow in response, old-fashioned in UI and demands too much clicks and scrolling from you.

I hope that one day our documentation portal will be redesigned from ground up in a way that it would match current UX/UI patterns. In the meantime I took a humble attempt to make it a little bit more engineer-friendly.

That’s how I ended up with two projects:

  • Web library with direct links to Nokia’ product documentation — NokDoc Lib
  • And the CLI tool to fetch links to documentation and download it — NokDoc CLI Tool

Read More...

Yang Explorer in a Docker container

yang_exp_featured

I would like to see a day come true where all major vendors’ boxes (even small & cheap ones) will be 100% covered by YANG models. Can’t say I believe that it is possible for IETF to standard all the things in vendors domain, but we will manage as long as vendors will stick to standard YANG in their own in-house data modes.

Being in shadows for quite some time, Netconf/Yang are still something new to explore for many of network engineers, myself included. And that’s todays topic — exploring YANG data models with Yang Explorer tool in a docker container (reads: without pain).

Updated version of Yang Explorer in a container has been published on my other resource — https://netdevops.me/2017/yang-explorer-in-a-docker-container-based-on-alpine/

Read More...

brvirt: when brctl meets virsh

featured

Hypervisors diversity is definitely one of the benefits of having Nuage managing your next-generation network. That means that we, as Nuage engineers, have to play with all kinds of hypervisors — like KVM, ESXi and Hyper-V to be more precise. As to me, I love to work with KVM most, simply because it gives you that feel that you are in control and can fine-tune or troubleshoot with granularity you want. Thanks to opensource tools like tcpdump, virsh, ss, top, brctl and many many others!

But these tools won’t fit perfectly for every situation every time. For example consider a simple case of a Linux host with a bunch of VMs connected via Linux bridges and answer a simple question: how to determine what VM names correspond to what virtual network interfaces connected to what bridges? I have to say that this question arises quite often when you troubleshoot network connectivity between VMs or gathering network stats.

And the answer to this question can not be provided with above mentioned tools without some scripting. Indeed, in this post I will share a script called brvirt which does the job by combining iproute2 and virsh outputs.

Link: Github repo.

Read More...

Using free Yandex DNS service in an automated way

featured

This DNS story started when I bought a domain with a specific need — to dynamically create and delete DNS records for Nuage Networks components we use during Proof Of Concepts and customers trials.

Earlier I used to rely on Dynamic DNS services (i.e. no-ip.com) whenever I needed a DNS name for my public endpoints. But this approach has two drawbacks:

  1. To use if for free you have to manually prolong you hostname once in a month. Drove me mad every time!
  2. In PoCs/trials you want your domain represent your product. Using hostname.ddns.net in front of a customer is not something that speaks well for your product. And we all know that devil is in the details.

Therefore I decided to buy a domain that will represent a product we are offering and park it to some provider which offers robustfree and API-enabled DNS service. Google cloud DNS and DynDNS while being both cheap are not free. So I kept looking and ended up with Yandex DNS which has all three traits I was looking for. Lastly I automated this DNS workflow so everyone in my team could provision their own DNS entries via one shared tool.

You got it right, in this post I am going to tell you about a completely free DNS service from Yandex with a decent API you can use for your personal needs. And yes, this post is accompanied with a python script which leverages API and automates DNS records provisioning.

Read More...

Using guestfish to modify VM disk image

EarIier I wrote about some ways to modify VM disk images used by Unetlab. Basically it boils down to running a VM, console to it and change things through its shell. Obviously, this approach is no way near a handy way to do small changes like:

  • loading basic config
  • adding license files

In this post I will talk about guestfish utility which is a part of libguestfs tools set. With guestfish one could easily get a shell-like access to the filesystem located on a disk image (qcow2, vmdk, iso and many others). That is how authors of libguestfs tools describe it:

libguestfs is a set of tools for accessing and modifying virtual machine (VM) disk images. You can use this for viewing and editing files inside guests, scripting changes to VMs, monitoring disk used/free statistics, creating guests, P2V, V2V, performing backups, cloning VMs, building VMs, formatting disks, resizing disks, and much more.

libguestfs can access almost any disk image imaginable. It can do it securely — without needing root and with multiple layers of defence against rogue disk images. It can access disk images on remote machines or on CDs/USB sticks. It can access proprietary systems like VMware and Hyper-V.

To demonstrate the way how guestfish works I will solve a particular task of adding a license file to Nokia (Alcatel-Lucent) 7750 Virtual Service Router (VSR) by embedding it to the disk image itself. Tune in!

Read More...

Making a docker container for a Flask application

plaza_docker_ft

Recently I presented to you a project called PLAZA which basically serves as a Web UI for python scripts. It was a pleasure to see that this project was welcomed well and some folks even asked how they can get PLAZA to play with. My fault, I wanted to release it so bad that I missed the part describing how to actually get it.

One way to get PLAZA that was available since the beginning – is cloning the github repo and building python virtual environment with all the packages. And I understand that nowadays this way seems too complicated and the case is ideal for learning some docker!

Join me in this journey for integrating a simple Flask application into a docker container.

Read More...

Building Web front end for Python scripts with Flask

featured

Recently I revived my relationship with Python in an effort to beat routine tasks appearing here and there. So I started to write some pocket scripts and, luckily, was not the only one on this battlefield – my colleagues also have a bunch of useful scripts. With all those pieces of code sent in email, cloned from repos, grabbed on network shares I started to wonder how much easier would it be if someone aggregated all of them, made a Web UI and shared this experience.

Thus, I started to build web front-end to python scripts with these goals in mind:

  • allow people with zero python knowledge to use the scripts by interaction through simple Web UI;
  • make script’s output more readable by leveraging modern CSS and HTML formatting;
  • aggregate all the scripts in one repo but in a separate sandboxed directories to increase code manageability.

This short demo should give you some taste of what it is:

Disclaimer: I am nowhere near even a junior python or web developer. And what makes matters worse is that I used (a lot) very dangerous coding paradigm – SDD – Stackoverflow Driven Development. So, hurt me plenty if you see some awful mistakes.

Read More...

Retrieving network elements backup from 5620 SAM

Last week I faced a routine (and quite common) task to get the latest backups of current configuration and BOF files for ~700 routers on a customers network. Sure thing sane man would use some automatization techniques, which could be:

  • 5620 SAM scripts
  • some scripting language to grab latest backups from the global NE backup location on a SAM server

I tried it both ways and invite you under the cut to read about it.

Read More...

Workaround for virtualenvwrapper for windows postactivate script

Virtualenvwrapper’s windows port (virtualenvwrapper-win) helps to manage your venvs on windows platform, yet it is not so straigtforward about using hooks like postactivate. That is what official documentation has to say about this:

Hooks

To run some commands after mkvirtualenv you can use hooks. First you need to define VIRTUALENVWRAPPER_HOOK_DIR variable. If it is set mkvirtualenv will run postmkvirtualenv.bat script from that directory. Version 1.2.0 (16-03-2015)

I tried to set VIRTUALENVWRAPPER_HOOK_DIR and place postactivate.bat there, but it didnt work out. The workaround I found for emulating postactivate behaviour is to edit postactivate.bat which is located in %WORKON_HOME%\<VENV_NAME>\Scripts

Read More...