You are here
Home > embedded > Testing >

How To Use Jenkins In Embedded System

This article explains Jenkins and Ceedling in embedded systems. This is divided into two parts, Installation and testing with Ceedling. I didn’t understand much about Jenkins, what it does and how it will be useful in embedded product development. So, I have decided to dig into this topic on “How To Use Jenkins In Embedded systems”.

There is a lot of documentation about Jenkins. Most of them are outdated, for instance, when I started to install Jenkins on Ubuntu, it did not go well.

Before we jump into subject, We at neudeep.com provide consultancy service at affordable price for development and unit test automation for embedded systems. Feel Free to contact us.

In this article I will explain more about Jenkins installation, using pipeline for Ceedling and Gcov.

I am using the following ceedling, Unity, CMock, and CException versions on Ubuntu bionic (18.04)

Ceedling:: 0.31.1
Unity:: 2.5.4
CMock:: 2.5.4
CException:: 1.3.3
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

Contents

What is Jenkins

Jenkins is mainly used as build automation server. It has web interface and you can install it on Windows, Linux or cloud server. Jenkins takes the code from the repo server like, SVN, git, github, bitbucket. It then creates binary file which will be loaded to board. During this build process, one can define to execute automated tests. The test results are available through Jenkins web interface.

In Embedded System Do We Really Need to Have Build Server?

Most of the embedded systems were small in nature, but these days due to IoT, AI/ML features, the embedded systems software is more complex. Which raises the need for automation. The build server automatically creates a build with known compiler settings, flags. These builds can be pulled by a tester from Jenkins web interface for further system testing. Here the developer has to fix the issue check in the code. Jenkins will pull that code, build it, run predefined tests and create the release. This process will be automated for every code check-in by every developer.

This saves the time of development team for build, test and releases process.

Install Jenkins on Ubuntu

The official link of Jenkins installation is not working and even other solutions from the internet using apt. It says “Package ‘jenkins’ has no installation candidate”, even tried with sudo access.

This I had installed using The Web application ARchive (WAR) file version of Jenkins,

Download the latest stable Jenkins WAR file  and run it using 
$java -jar jenkins.war

Browse to  http://localhost:8080  and wait until the Unlock Jenkins page appears.

jenkins setup on ubuntu

Now enter the password from the command prompt.

Jenkins initial admin password

I have selected Install suggested plugins – to install the recommended set of plugins, which are based on most common use cases.

jenkins install plugins on ubuntu

Now, create first admin user

jenkins first admin user on ubuntu

Install Jenkins On Windows

Jenkin installation on windows 11 or the latest version is also not straightforward. I have installed jenkins using jenkins.msi file from the official website. In my system there was one default user. Jenkin requires user log on as service access under user rights assignments. This is explained in this article.

After this I am able to verify the user and proceed to next step. Here Jenkin requires Java 1.8 or later, by default windows will point you to the program files folder,

jenkin windows path

Here I have updated with program files x86 path and it worked as follows,

Jenkins Java Path

Rest other steps are the same as Ubuntu installation, except the initial admin password for windows is in jenkins appData/local path.

Jenkins windows path for initial admin password

How To Use Jenkins In Embedded System

I am configuring Jenkins as a single server with build and webserver on the same machine. This is to keep it simple. The next step is to create a new project and point it to your SVN/git repo.

Jenkins SVN setup on Linux

By default only git is available, you need to install the svn plugin if you are using svn as your project’s source control repository. Once your first build is successful you can define the pipeline for unit testing. On the build server, you will require a compiler, which is already there since I am using the local machine for Jenkins.

First Jenkin Pipeline

I have defined a simple pipeline, it fetches the code from SVN, builds it, runs unit tests using ceedling and generates coverage reports with gcov utility of ceedling.

This Stage View shows all the stages of the pipeline that are executed with each build. Hope you have enjoyed this article on How To Use Jenkins In Embedded System. In next article will explain more about using ceedlling and jenkins.

Looking for specific solution, you are welcome to contact us.

Leave a Reply

Top