Novell is now a part of Micro Focus

Linux Automation Framework

Novell Cool Solutions: Feature
By Yatin P. Manerker

Digg This - Slashdot This

Posted: 2 Nov 2006

  1. Introduction
  2. Basic block Diagram of the Framework
  3. Explanation of Block
  4. Configuring the Automation Server for Framework
  5. Using the Tool
  6. Design Details
  7. Script Details
  8. Customizing the Tool
  9. Conclusion
  10. References

Download: html.tar.bz2
Download: scripts.tar.bz2

1. Introduction

It is often noticed that if you want to run the automated test on a remote server then one thing you require is an agent running on the server so that all of the commands given from the controller is executed on the server. The agent is the small piece of code which resides on the test server and activates a port on the test server, so the commands given from the controller will be executed on the test server.

I have designed a small framework which will not require any agent running on the test server machines. The need for implementing such a tool occurs mostly in case of testing an application which requires the installation of a fresh OS for each phase of testing. This happens when the server itself is in the development stage or an application running on the server is changing continuously for each iteration and which requires the server should be freshly installed. When the OS (build) itself is changing, then the agent which is configured on the OS needs to be configured again and again for each new installation.

This framework will be used to start any test on a Linux server without having any agent running on the server. Different scripts can be plugged into the framework.

* Note: All operations are performed using ssh.

2. Basic Block Diagram of the Framework:

3. Explanation of Block:

The Automation server has all of the scripts it requires to test the remote server. From the client machine all the details about the test can be entered . The Automation server will take all the input parameters and it will contact the remote test server. Once authentication is done, the automation server will transfer the script to the test server and it will start the script on the test server.

Test results will be sent back to the user once the test is completed.

* Note: Sendmail code should be there in test script.

4. Configuring the automation server for framework:

For configuring this tool you should have SLES9 server with Apache installed.

  • Step 1: Create a directory called automation-framework in /srv/www/htdocs
  • Step 2: Extract the tar ball (html)and copy to /srv/www/htodocs/automation-framework
  • Step 3: Extract the tar ball (scripts) to /scripts locations. Create a directory called /scripts.
  • Step 4: Start apache server
  • Step 5: From any client open the web page http://<IP address of the automation server>/automation-framework

5. Using the tool:

From any client machine open the automation framework page.

Enter the IP address, and password of the remote server. Select the script and substitute the parameters for the type of test. For arguments of the script, refer to link "click here". Enter the email id if you want notification through mail. Click submit.

The following page shows the output results.

Note: This is the output results. This tool will give the notification of the test which is running on the server. Your scripts should have a code to mail the output results.

6. Design details:

The front end of the tool is designed using HTML and PHP. There are some PHP shell functions which are used.

Expect is used in back end. The Expect script will take the input from the web page as parameters and it will contact the test server, copy the required script in the server, and execute.

7. Script details:

Scripts are divided into two types:

  1. Front end scripts
  2. Test scripts
Front end scripts: (HTML tar ball)

  1. index.php (Index page which opens when you goto the automation link)

  2. submit.php (Display the results)

  3. usage.txt (Displays the usage of various scripts and their parameters)

  4. run1.exp (Expect scripts which will take the input parameters from the web page)
    Note: In this script password of the automation server should be there. Currently it will show "novell" as the password. Replace novell with the password of the automation server.

  5. (This script will take the email id entered in the first page and it will send the mail to the users notifying the start of the test on remote server)

Test scripts:

Here are some sample PERL scripts for creating data sets. When the scripts are executed from the command prompt, it will ask for different inputs as parameters. The parameters are supplied from the front end HTML page.

8. Customizing the tool

This can be easily done in the following way:

  1. If you want to add New scripts in the tool. Copy the script to the script location. Add the entry in the index.php file for the script. <select name= "Script">
  2. Goto usage.txt file and enter the usage of the tool
  3. Goto submit.php file and make a new entry in the "if loop" for new script.

9. Conclusion

Any test scripts can be plugged in the automation framework.

10. References:

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates