Tips & Tricks for Testing and Managing Web Applications Run by Linux OS

By Vijay

By Vijay

I'm Vijay, and I've been working on this blog for the past 20+ years! I’ve been in the IT industry for more than 20 years now. I completed my graduation in B.E. Computer Science from a reputed Pune university and then started my career in…

Learn about our editorial policies.
Updated June 23, 2024

How to Test, Manage, and Configure Web Applications Run by Linux OS:

Let’s find out how to manage the fastest-growing operating system today in web application testing. The following applies if your application is running on servers operated by any Unix-like distribution.

This tutorial will be useful for any novice Linux user during his or her education. Especially, we describe below the most frequently asked questions that we have to solve during our Linux study.

Web Application Testing and Management

Test, Manage, and Configure Web Applications

We will run through a few essential topics that any QA Engineer will probably face while managing and testing web applications run by Linux OS.

Recommended read => UNIX basics for Software Testers

There are few regards to history. It was hard work by real Linux followers to bring *nix OS merits to bear on the IT Community in the past. Thanks to them, this operating system is in full swing now.

Global statistics reveal Linux is the primary operating system for most supercomputers and highly loaded application servers. Linux servers are the most stable and productive environments designed to be shared by many users (For Example, social networks).

Let us get it started with a few comparisons:

Windows vs Linux

Windows vs Linux
  1. The main and overbalancing advantage of Linux is its free license: FLOSS (Free/Libre and Open-Source Software). Many distributions come pre-loaded with a wide range of software and drivers at no cost.
  2. Support, fixes, and new features are provided by the Unix community (developers and foundations over the world) rather than Windows is developed and supported by the only Microsoft corporation.
  3. Linux is extremely flexible and ready for any user configurations and changes. It results in any system to be unique and user-specific. Unfortunately, that is not true about Windows installed on your PC.
  4. To the previous point, all attempts of hackers and malicious software producers to break Linux security with viruses don’t have a real impact. Honestly, it doesn’t make sense and is considered “unpopular”. It’s widely accepted that Linux surpasses Windows in terms of security and stability.
  5. As we mentioned above, high performance is expected by web and telecom users. We cannot ignore the point that the same hardware will be significantly more productive if run by Linux. More than 95% (!) of supercomputers are operated by *nix. That is not a coincidence!

This is only a part of all the advantages we could list here. Let’s keep on moving.

First, we’d like to list some hints that could help to avoid its specific singularities.

Tips & Tricks of penguin taming: web application testing

General *nix Must-Knows

Let us start with some essential but simple points here:

  • The best command for a novice Linux user to start with is a man. It displays online manual pages for the specified command. For Example, man ls. This will return info regarding the command you possibly want to learn: Name, Synopsis, Description, Options.
  • Command names, paths, and file names are case-sensitive. For Example, “test.log” and “TEST.log” could be different files in the same directory.
  • Using spaces in file names within the terminal (console) will cause incorrect behavior because spaces are originally used for pointing multiple arguments of the command. Use an underscore or CamelCase (PascalCase) instead (For Example, “test_log” or “testLog” instead of “test log”).
  • To rename a file use the mv command: mv test.tar.gz temptest.tar.gz. It changes the name of test.tar.gz to temptest.tar.gz.
  • There is no “undo”. It’s not possible to restore overwritten or modified files to their original state in Linux.
  • There is no “Trash” or “Recycle Bin”. Most Unix distributions do not have standard tools to recover deleted files and folders. So, make sure you delete only necessary files: specify unique parameters for the rm command. For Example, rm -I test*.txt (user will be prompted. Finally, the alias command will help to reconfigure the rm command call if you care about data loss.
  • Don’t forget to use shortcuts: current directory (.), parent directory (..). And that’s why you have to keep an eye out not to run: rm -r .*, because this command will delete the parent directory (the expression matches “..”).
  • Also, anyone who works within the console should know the autocomplete function for command or file names: just type a few first characters of a name and press the Tab key.
  • And one more useful hint here is to access recent command history. Use the up and down arrows on the keyboard to browse commands run previously.

Name And Path Limitations In Linux OS

Meanwhile, I’d like to draw your attention to a few details about path types and name length limitations in the *nix OS.

First, let’s specify common terms.

An absolute path means the location of a file or directory from the root directory (top level): For Example, /var/log/protocol/log.

Relative path means path related to the current directory (pwd). For Example, you are located in /var/log and you want to go to the following directory /var/log/protocol/log/. You can use a relative path here, so just apply cd protocol/log/.

Finally, there are the following limitations applied to folder and file names in *nix (these limitations should also be checked during the test of your web application):
– 256 characters for a name;
– 1024 characters for an absolute path.

It’s prohibited (or impossible due to an unknown or hidden password according to security policy) to log in as the root user (technically, the top-level user, Administrator). However, most daily administrative tasks in a routine require administrator permissions, such as starting/stopping web apps, restarting/cleaning databases, and deploying new builds.

The actual workaround here is to use the sudo command (requires a password as well): superuser does. So, use sudo followed by the required command to perform activities with so-called superuser permissions: sudo apt-get install shell utilities.

Job And Process Management In Linux

The administration of the Linux host (where your web application runs) requires frequent job and process managing activities.

We have listed a few must-knows below:

  • Use shortcut Ctrl-C to interrupt a job.
  • Use shortcut Ctrl-Z to resume a job. The command FG will restart such a job and bg will place a job in the background (to perform additional tasks in parallel). Also, add an ampersand (“&”) to your command at the end of the string to start it in the background.
  • Run “ps” to view currently running processes. All jobs have unique process IDs, displayed in the first column of the output. There are some more useful options here to modify its result view.
  • Run “kill / killall” followed by the process ID (or process name) to end the required job. For Example, kill 22064; killall java.
  • Additionally, you can seek for the specific job you want within the process list by the grep command: grep is a very efficient search tool with a large scope of configurations. Example: ps -aux | grep java. The ps returns the list of all processes. The grep filters the list according to your search criteria.

Installing New Software on Linux: 3 Main Methods

installing-software-on-linux

I’d like to finish this Intro with the following instructions on how to install new software in Linux at this point is exceptionally challenging and called for among former Windows users. The most common methods are below:

  • Installing RPM packages
  • Installing DEB packages
  • Installing from tarballs (esp. Source code).

First, any Linux user should know such things as software repositories. The repository is a storage for packages (both source and binary) accessible via the Internet to install any required software on your computer.

You can easily select which to use or even create your own one: the list of connected repositories is stored here by default (examples for the most popular utilities):
– YUM: in files repo in the directory /etc/yum.repos.d/;
– APT: in file /etc/apt/sources.list and in the files in the directory /etc/apt/source.list.d/.

Click here to learn more on how to install new software/packages on Linux OS.

Basic Tools For Testing Linux Applications

Further, coming to the technical side of testing itself, you can find a basic set of instruments for testing Linux applications you will definitely face while testing them. But most of these solutions apply to the majority of Unix-based systems and they are console-based which is easier to automate, in fact.

On Linux, all programs can be divided into the following groups:

#1) Core (Kernel)
This includes the core itself, the kernel modules, and the userspace level for kernel control (meaning the / proc and / sys interfaces). Since the kernel itself is written in C and ASM, then for testing you’d basically better use C. Usually, these are small test kernel modules, checking some functions or modules with different parameters + scripts.

As practice shows, it’s better not to use one module checking the whole “feature”, but many modules checking each of the functions separately. You should also not forget to check all function return codes.

#2) User applications (userspace level)
Any application running on that OS. Of course, if such an application is written in Java, you’ll need to own Java, at least to make sure that the program is working.

#3) Core + User applications
Most likely this kind of application will interact with the most. This scheme encompasses the core driver provides low-level communication with any device and the user program.

Linux is really convenient for programming and testing. Almost all the tools are present in any distributive or can be downloaded as they are distributed free.

Let’s try to describe all the tools for testing Linux applications:

#1) GCC – Gnu C compiler
Basic C, C++ compiler for Linux. If you need to test the compiler, the gcc site has special tests. Compiling with the -g option will make debugging with gdb.

#2) bash
The BASH shell is also included in each distribution. It is in fact, very useful for writing scripts.

#3) expect
Also present in each distributive. Rather simple but very handy syntax TCL.
– expect-perl ? expect-python (pyexpect) – libraries except for scripting languages, Perl and Python.

#4) gdb – Gnu Debuger
This is a standard C / C + + debugger having a lot of opportunities. If you have never used it, I advise you to get acquainted with it. Use kgdb for a kernel.

#5) ltt – Linux Trace Toolkit
If your Linux core supports LTT, you can view the active processes/system calls in the current process.

#6) import? gimp – can be used for taking screenshots of testing graphics applications.

#7) minicom
A program for manual testing. If you want to automate the console, it is better to use the expect (or in conjunction with the “cat” and “echo”, or just open / dev / ttySx as a file – sometimes the second option does not fit).

#8) ltp – Linux Test Suite Page [ltp.sf.net]
Very useful collection of tests. Includes tests of file systems, system calls, and more.

#9) Some more common tools:
netperf – utility to verify the network performance.
ircp, irdump, openobex – Utilities for infrared checking.
telnet, ssh – remote shell. If you frequently enter the same command, you can use expect in any distributive.

Conclusion

That’s it for now. Today we learned a bunch of entirely important topics that cover FAQs, Linux singularities, process management, specific limitations, and some more points that could be vital for QA services in the sphere of web application testing.

We have tried to list useful examples as well as to demonstrate the ways new software could be installed. Starting from this article, you could keep on investigating the most stable, efficient, safe, and legal operating system ever. We hope you’ve realized it makes sense!

About the Author: This is a guest post by Alexander Panchenko, who works as Head of the Complex Web QA Department for A1QA.

He has good experience working on various projects like backup and recovery applications, and projects with complex business logic. For Example, corporate portals based on SharePoint, Banking systems, and Government portals. Now he is leading several teams of 7+ people and managing a division of 30+ engineers on board.

Good luck in testing, managing, and configuring applications that are installed on servers operated by Linux OS!

Need help in testing applications on Linux or any UNIX-based systems? Just put your queries in the below comments and we will try to resolve it.

Was this helpful?

Thanks for your feedback!

Recommended Reading

8 thoughts on “Tips & Tricks for Testing and Managing Web Applications Run by Linux OS”

    • As a junior QA engineer, software engineering.
      Now in reality, if you have proper education and are looking for a job, learn Python, JS, SQL, HTML, and you’ll be the same qualifications as a proper software engi, minus the engi title, but plus 3 years of your life.
      I’m currently trying to learn JS after dribbling in python, I already know SQL and have a great book to learn from if you have the time, HTML and simple CSS I learned through the course I did online.
      The best option tho is to have a mentor to guide you on your journey. Or else you might get lost in this sea of code.

      Reply

Leave a Comment