Skip to content

Install Instructions

Zoltan Micskei edited this page Apr 21, 2016 · 11 revisions

Install Instructions

1. Overview

In this tutorial you can get familiar with the installation and configuration of the SETTE framework. At the moment test execution is only available in Linux because certain tools are bound to Linux. However, other features of SETTE only depends on Java SE 8, so any other OS with a Java 8 environment is suitable.

From the three tools (CATG, jPET, SPF), CATG requires Linux or Cygwin and jPET requires Linux. Thus, evaluating all the three tools at least a Linux-based OS is needed for tool execution. There are several ways to evaluate test generator tools regarding the environment. The following document presents how you can configure a Linux-only or a Windows-Linux environment for development. We used a Windows-Linux architecture used by us.

1.1 Linux-based development machine

This solution is simple and clear: use only Linux for development and evaluation. This environment is the best when you would like to quickly set up and try SETTE.

1.2 Windows-Linux environment

In this environment tools are installed on Linux but this machine is only used for tool execution. The development of SETTE and the code snippets and the other evaluation phases are carried out on the Windows machine. This environment is ideal for you if your host is Windows, but you do not want to experience performance drawbacks during development.

There are several ways to keep your files sync between the two operating systems:

  • Share the Linux partition over Samba:
    • You can access it from Windows as a Network Drive.
    • You can even use a separate (independent) hard disk and format it EXT4/NTFS
      • Our experiences has shown that file transfer throughput is greater for shared EXT4 drives in case of typical SETTE files.
      • However, the NTFS drive is mountable to Windows if the VM is shut down.
    • You can use e.g. FreeFileSync for file synchronization.
  • Share the Windows working directory over the network:
    • You can access and mount it from Linux using Samba.
    • The files are stored at one location, thus no synchronization is needed, however, using this method the evaluation will be a little bit slower.
  • Share the working folder with VMware:
    • Although this would be the trivial solution, we do not recommend, because SETTE generates many files in a short time span and sometimes the files disappear and you have to re-run the VMware configuration script. This behaviour is not detected by SETTE.
  • Use a cloud service to sync the files:
    • We recommend to avoid this solution, because SETTE and the tools usually generate a lot of small files in a short time span and this can result in slow sync or even conflicts.

2. Installing the virtual machine

This section describes how to create the virtual machine used for only tool execution. This is based on Ubuntu Server, however, this tutorial applies to the majority of the Debian-based systems and you can also use a desktop edition.

If you are not interested in setting up the development environment and you just want to see SETTE in action, simply install an Ubuntu Desktop and jump to section 3. Set up SETTE.

2.1 Install the operating system and essentials

2.1.1 Create Virtual Machine

The generator tools are resource intensive, that's why we recommend to use the following configuration (the SETTE tool itself does not need considerable resources):

  • VMware Player 6 or Workstation 10
  • CPU: 2 cores
  • Memory: 4096 MB RAM
  • Network: NAT (192.168.10.0/24)
  • Hard drives:
    • 8 GB for system
    • 10 GB for data (independent and persistent)

2.1.2 Install Ubuntu 12.04 LTS Server (64-bit)

You can also install a Desktop edition of any other Linux-based OS, however this tutorial focuses on Debian-based systems.

  1. Download an image file of the OS
  2. Mount the image file as a CD/DVD disk to the virtual machine
  3. Start installation. These are the settings used by us:
  • Language: English
  • Keyboard: Hungarian
  • Location: United Kingdom
  • Timezone: Europe/Budapest
  • Hostname: sette
  • Username/password: sette/sette
  1. Hard drive: 8 GB, no LVM
  2. Network settings:
  • For DNS servers use your default DNS servers or you can use the Google DNS servers (8.8.8.8 and 8.8.4.4)
  • Use your default proxy settings or choose "No proxy"
  1. Choose "Install security updates automatically"
  2. Install OpenSSH server and GRUB
  3. Reboot

2.1.3 Install VMware Tools

Execute the following commands:

sudo –i
apt-get update
apt-get upgrade
apt-get install build-essential
apt-get install linux-headers-`uname –r`
mount /dev/cdrom /media/cdrom
cd /tmp
tar xfvz /media/cdrom/VMwareTools-[…].tar.gz
cd vmware-tools-distrib
./vmware-install.pl
reboot

From now you can work from SSH instead of the VMware GUI.

2.1.4 Install a few useful programs

sudo –i
apt-get install mc

2.1.5 Partition the second hard drive

Should I format the partition as EXT4 or NTFS?

With ntfs-3g both NTFS read and write are supported, however, using it on a virtual guest it has performance issues (even if the virtual disk is on a solid-state drive). Only use NTFS if you would like to map the virtual disk on Windows based computers. Otherwise, EXT4 is advised. (Note: there are several EXT4 drivers for Windows, but they can only read from the partition).

Create partition

sudo -i
fdisk /dev/sdb
# press 'n' (new partition)
# press 'p' (primary)
# press '1' (1st partition)
# press Enter (default first sector)
# press Enter (default last sector)
# press 'w' (write changes)

Format partition as EXT4 and set auto-mount

sudo -i
ext4 /dev/sdb1 
mkdir /data
chmod 0777 /data
chown sette /data
chgrp sette /data
mcedit /etc/fstab

# Add this line at the end of /etc/fstab (without the #):
#/dev/sdb1    /data      ext4  rw,user,exec       0    0

reboot

Format partition as NTFS and set auto-mount

sudo -i
ntfs -f /dev/sdb1
mkdir /data

chmod 0777 /data
chown sette /data
chgrp sette /data
mcedit /etc/fstab

# Add this line at the end of /etc/fstab (without the #):
#/dev/sdb1    /data      ntfs  defaults      0    0

reboot

Please follow these steps to mount the NTFS drive in Windows properly:

  • Shut down the virtual machine
  • VMware: Map drive
  • Format the mapped drive in Windows Explorer, add label "SETTE"

Remove partition from disk

sudo –i
mcedit /etc/fstab
mount -a

# Remove the line for the partition from /etc/fstab

fdisk /dev/sdb
# press 'd' (delete partition)
# press 'w' (write changes)
reboot

2.1.6 Share the second drive with Samba

# Run the following commands:
sudo –i
apt-get install samba
mcedit /etc/samba/smb.conf

# Find the the section [global] -> Authentication -> uncomment "security = user"
# Add at the end of the file add:
[data]
  path = /data
  read only = no
  browsable = yes
  guest ok = false
  create mask = 0777
# End of file

# Run the following commands:
smbpasswd -a sette
Password: sette
smbpasswd -e sette
restart smbd
restart nmbd

Now the drive can be mounted in Windows as a network drive (e.g. S:), use sette/sette as credentials

2.1.7 Optional: back up

Back up the virtual machine.

3 Set up SETTE

3.1 Install Java

You can use your favourite JDK, however, if you would like to use Oracle JDK 8 you should do the following steps (please note that the JAVA_HOME environment variable should be set properly):

sudo -i
apt-get install python-software-properties
add-apt-repository ppa:webupd8team/java
apt-get update 
apt-get install oracle-java8-installer
apt-get install oracle-java8-set-default
echo "JAVA_HOME=/usr/lib/jvm/java-8-oracle/" >> /etc/environment

Log out and log in to apply the changes.

3.2 Install dependencies

sudo apt-get install ant mercurial git

If you copy the Mercurial repository from another location or you would like to access as another user, you should add the certain users to Mercurial's trusted user list:

sudo mcedit /etc/mercurial/hgrc
# Add the following lines to the file:
[trusted]
users = root, sette

3.3 Checkout SETTE from GitHub

  • You should check out the following repositories from GitHub:
    • sette-tool (required): the source code and dependencies of SETTE and the initializer scripts for the test generator tools (currently CATG, jPET and SPF)
      • ./src/ - the sources of SETTE
      • ./test-generator-tools – the installers/initializers for the symbolic tools
    • sette-snippets (recommended): our code snippets for evaluation purposes
      • ./sette-snippets/ - the code snippets
      • ./sette-snippets-external/ - the external library used by the snippets
    • sette-results (optional): our evaluation results
  • Please keep in mind if you do not checkout the repositories into the same directory, you have to do further modifications to the sette.properties file.

3.4 Install test generator tools

If you have some of these tools already set up, simply skip the corresponding section. When editing sette.properties, you should specify your own tool locations.

Install CATG

  • Run the get-tool.sh script (located in the sette-tool/test-generator-tools/catg directory)
    • The script downloads the v1.03 version of CATG, unpacks it and applies our patch. The patch disables the compilation of CATG tests and makes the tool ready to use for SETTE.
  • Get and install yices2 from http://yices.csl.sri.com/
    • Download the .tar.gz file for Linux (64-bit)
    • Execute the following commands:
tar xfvz yices-[…].tar.gz
cd yices-[…]
sudo ./install-yices

Install jPET

  • Run the get-tool.sh script (located in the sette-tool/test-generator-tools/jpet directory)
    • The script downloads the pet executable.

Install Symbolic PathFinder (SPF)

Symbolic PathFinder is and extension for Java PahFinder (JPF). JPF uses the file ~/.jpf/site.properties as configuration, so if you have previously installed JPF or SPF, you need to do different steps unless you want to override your previous configuration.

If you have neither JPF nor SPF for your user, please do the following steps (or if you have, you can use another user which does not have JPF configuration and do these steps):

  • Run the get-tool.sh script (located in the sette-tool/test-generator-tools/spf directory)
    • The script checks out the jpf-core and jpf-symbc repositories and configures JPF (the file is located at ~/.jpf/site.properties).
  • Run the update-tool.sh script
    • The script updates the JPF/SPF repositories.
  • Run the build-tool.sh script
    • The script initiates build on the JPF/SPF projects.

If you already have JPF configured on your computer, but no SPF, please do the following steps:

# JPF site configuration
jpf-core = [path to your jpf-core directory]/jpf-core
jpf-symbc = [path to your jpf-symbc directory]/jpf-symbc
# you might have other JPF components

extensions=\${jpf-core},\${jpf-symbc}
# you might have other active extensions
  • Build both JPF and SPF with ant
  • Edit sette.properties and set path the to RunJPF.jar.

If you already have both JPF and SPF configured on your computer you only need to edit the sette.properties and set path the to RunJPF.jar.

3.5 Compile SETTE

  • sette-snippets:
    • Run the build.sh script (located in the sette-snippets directory)
  • sette-tool:
    • Run the build.sh script (located in the sette-results directory)
    • Rename sette.sample.properties to sette.properties
    • Open and edit sette.properties
      • The basedir property should be changed
    • Now SETTE is ready to use

3.6 Run SETTE from Eclipse

  • Open Eclipse (any with Java 8 support is eligible)
  • Create a workspace
    • Note that projects physically outside of the workspace can be added to it
    • If you would like run SETTE from Eclipse, your workspace cannot be located in a folder called "sette". We recommend to create the workspace at "[working directory]/workspace" and leave it empty.
  • Import and open all the SETTE projects
    • Pay attention not to open other projects, like JPF/SPF repositories.
  • Clean and Rebuild all