User:Plauchu Edwin

From Yocto Project
Jump to navigationJump to search

Software developer over several open source languages

Setup harness server

OS Installation

The Linux distribution installed upon harness server during the creation of this document is Ubuntu yakkety.

Important facts upon installation

During Installation process of Ubuntu It'll be requested the creation of a user, please create the user with the name 'tester'. Finally the computer name shall have to be 'testing-harness'.

Ram and Disk distribution

The Ram and Disk details upon this harness server during the creation of this document are:

root@testing-harness:~# free -m
              total        used        free      shared  buff/cache   available
Mem:          15945         251       12904          54        2790       15311
Swap:         16278           0       16278

root@testing-harness:~# fdisk -l /dev/sda
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: B15E7DED-0607-4F32-8072-8CEC8041A1A8

Device          Start        End    Sectors   Size Type
/dev/sda1        2048    1050623    1048576   512M EFI System
/dev/sda2     1050624 1920184319 1919133696 915.1G Linux filesystem
/dev/sda3  1920184320 1953523711   33339392  15.9G Linux swap

root@testing-harness:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
tmpfs           1.6G  9.3M  1.6G   1% /run
/dev/sda2       901G   39G  817G   5% /
tmpfs           7.8G  156K  7.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/sda1       511M  3.4M  508M   1% /boot/efi
tmpfs           1.6G   44K  1.6G   1% /run/user/111
tmpfs           1.6G     0  1.6G   0% /run/user/1000


Firewall configuration

Firewall configuration is not provided, it is recommended that the testing harness is only kept in a trusted network.

To check if no firewall are configured over testing-harness, we can expect a similar output when inquiring iptables...

root@testing-harness:~# iptables -L && iptables -t nat -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         

Setup Security shell

OpenSSH is a freely available version of the Secure Shell (SSH) protocol family of tools for remotely controlling, or transferring files between, computers. That's why it is required its installation upon testing-harness server.

root@testing-harness:~# aptitude install openssh-server 

Setup NFS

AFT applies Network file system to share /home/tester directory where images and other files used in flashing for PC-devices within AFT net can be found.

NFS is installed ?

To check if the NFS server is installed, we can do...

root@testing-harness:~# dpkg -l | grep nfs-kernel-server
How to install NFS ?

To install NFS these are the required packages...

root@testing-harness:~# aptitude install nfs-kernel-server
The following NEW packages will be installed:
  keyutils{a} libnfsidmap2{a} libtirpc1{a} nfs-common{a} nfs-kernel-server 
  rpcbind{a} 
0 packages upgraded, 6 newly installed, 0 to remove and 459 not upgraded.
Need to get 470 kB of archives. After unpacking 1 884 kB will be used.
Do you want to continue? [Y/n/?]
Sharing /home/tester directory
root@testing-harness:~# mkdir -p /home/tester
root@testing-harness:~# echo '/home/tester 192.168.1.0/24 (crossmnt,ro,root_squash,sync,no_subtree_check)' >> /etc/exports

Setup DNS cache and DHCP server for AFT net

DNSmasq provides two services, either of which can be used independently.

  1. DNS service
  2. DHCP service

A local DNS cache can speed up internet browsing because the user's applications will not need to access a domain name server when it looks up a domain name the computer has visited before.

How to install dnsmasq ?

To install dnsmasq these are the required packages...

root@testing-harness:~# aptitude  install dnsmasq
The following NEW packages will be installed:
  dns-root-data{a} dnsmasq dnsmasq-base{a} 
0 packages upgraded, 3 newly installed, 0 to remove and 459 not upgraded.
Need to get 0 B/329 kB of archives. After unpacking 886 kB will be used.
Do you want to continue? [Y/n/?

At the sametime we have set up a simple DNS server. To test it, use your favorite DNS lookup tool pointed at localhost

root@testing-harness:~# nslookup yoctoproject.org localhost
Server:		localhost
Address:	127.0.0.1#53

Non-authoritative answer:
Name:	yoctoproject.org
Address: 140.211.169.56
Configure DHCP server

To enable the DHCP server of AFT net, you will need to give it a range of IP addresses to hand out. The AFT net server would hand out 92 address starting at 192.168.1.2 and ending at 192.168.1.99.

root@testing-harness:~# echo 'dhcp-range=192.168.1.2,192.168.1.99,10m' >> /etc/dnsmasq.conf

To tell dnsmasq which ethernet interface it can and cannot listen on.

root@testing-harness:~# echo 'interface=eno1' >> /etc/dnsmasq.conf

During the creation of this document the interface eno1 is the unique one connected to AFT net.

AFT and its relation with dnsmasq.leases

As of dhcp server is up and running. AFT shall utilize dhcp-server's active ip leasing information to determine device IP address of PC-devices over AFT net. By default it is found upon /var/lib/misc/dnsmasq.leases

root@testing-harness:~# cat /var/lib/misc/dnsmasq.leases

1417132679 78:c5:e5:b4:4d:07 192.168.1.99 minox-fbe390b0bb404da *
1417134678 20:54:76:e4:d8:a5 192.168.1.57 minoy-ab6e5d0a524c9c7d *
......
.......
........ and so on...

Above a common dnsmasq.leases file.