TestingInfrastructure

Applications that can be used to do some testing on the device

Projects and/or hardware that can be used to do functional testing

Lava

Lava can be used to do functional tests on real hardware. It can be easily installed on PureOS, an FSDG compliant GNU/Linux distribution.

Labgrid

Labgrid has features similar to Lava but it is probably easier to learn because it's probably way easier to get started with it.

OsmoGSMTester

The OsmoGSMTester project is able to be interfaced with the Android RIL through ofono and can emulate a GSM network with the help of a compatible GSM base station or SDR.

This presentation from 2019 has many insights on what kind of issue we might expect in interfacing it with smartphones.

Simtrace2

The Simtrace 2 project can be used, along with SIM card readers to programmatically feed a SIM card to a smartphone. This can be used to run test on real networks.

Replicant supported devices and testing

Requirements

Galaxy SII (GT-I9100)

Holding the smartphone in place: SIM cards:

Serial port and USB:

Buttons:

Battery:

Antenna connector and GSM tower or SDR:
The Galaxy SII (GT-I9100) has two antenna connectors:

Example setup

See also the links inside the Serial_port article for more background on how to get serial port access on devices like the Galaxy SIII (GT-I9300) or the Galaxy SII (GT-I9100).

test infrastructure example (https://git.replicant.us/contrib/GNUtoo/test-infrastructure.git/plain/i9100.dot)

See https://git.replicant.us/contrib/GNUtoo/test-infrastructure.git for the source of the file.

Using a device without a battery.

Sumarry

Device Modem antenna connector Compatible software Comments
Motorolla C155 MS-147 * OsmocomBB
* Old Nuttx revisions
Could be used as reference phone as it's probably already supported by the Osmocom testing infrastructure
Galaxy SII (GT-I9100) MS-162 * Replicant 4.0, 4.2, 6.0
* Upstream Linux (partial)
Galaxy Nexus (GT-I9250) ? * Replicant 4.0, 4.2, 6.0 We can get some GSM traces in wireshark with xgoldmon
Galaxy SIII (GT-I9300) ? * Replicant 4.0, 4.2, 6.0
* Upstream Linux (partial)

USB modems

When trying to enable protocol tracing in modems we can connect the device modem (somewhat directly) to a laptop

Questions:

Pure software setup

lightweight test infrastructure for libsamsung-ipc

It might be possible to have a pure software test infrastructure with libsamsung-ipc.

It could be done more or less like that:

test script <-> ipc-modem or other programs <-> libsamsung-ipc <-> Linux kernel <-> VHCI <-> software sending USB packets

We have several choices for the Linux kernel:

Kernels Comments
User mode Linux (ARCH=um) (+) Very lightweight, runs completely in userspace
(-) Requires patches for USB / VHCI
Linux + libvirt + kvm (-) Require some virtualization setup that requires dedicated RAM
(+) Probably works unpatched
And there is already some projects emulating usb devices:
Project Description comments
gnuk USB token software can build for gnulinux
choptix Library used by gnuk More simple examples
simtrace2 ? SIM tracing and MITM tool Probably uses vusb for testing too

So it might be possible to modify them to send some simple USB packets captured with wireshark / tshark / tcpdump.

user mode Linux

I've already managed to find a configuration that works in an FSDG compliant way:
Settings Status
kernel: kernel_replicant_linux
(replicant-11-test branch at the time of writing)
compilation settings: ARCH=um
Host architecture: x86_64
kernel defconfig: x86_64_defconfig
Target Distribution: Parabola x86_64
commandline arguments: ./linux mem=2047M ubd0=parabola.img root=/dev/ubda1
Boots fine
kernel: kernel_replicant_linux or upstream Linux
compilation settings: ARCH=um
Host architecture: i686 or x86_64
kernel defconfig: i686_defconfig
Fails to compile

To run Parabola first you need to create an image.
Then you need to chroot (with arch-chroot) insde the image and change the password.
Once you exited the chroot and unmounted the image and removed the loop mapping, you can boot it.

During boot you'll see a message like that at the end:

Virtual console 1 assigned device '/dev/pts/4'

You can then login in this way:

$ sudo picocom /dev/pts/4 
picocom v3.1

port is        : /dev/pts/4
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready

parabola login: root
Password: 
[root@parabola ~]# cat /etc/os-release 
NAME="Parabola" 
PRETTY_NAME="Parabola GNU/Linux-libre" 
ID=parabola
ID_LIKE=arch
BUILD_ID=rolling
ANSI_COLOR="1;35" 
HOME_URL="https://www.parabola.nu/" 
DOCUMENTATION_URL="https://wiki.parabola.nu/" 
SUPPORT_URL="irc://chat.freenode.net#parabola" 
BUG_REPORT_URL="https://labs.parabola.nu/" 
LOGO=parabola
[root@parabola ~]# 

TODO: