Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Librem5/librem5-devkit-tools
  • angus.ainslie/librem5-devkit-tools
  • jeremiah.foster/librem5-devkit-tools
  • guido.gunther/librem5-devkit-tools
  • dorota.czaplejewicz/librem5-devkit-tools
  • mog/librem5-devkit-tools
  • bob.ham/librem5-devkit-tools
  • zgyarmati/librem5-devkit-tools
  • johkra/librem5-devkit-tools
  • emdete/librem5-devkit-tools
  • eetorre/librem5-devkit-tools
  • abpro0000001/librem5-devkit-tools
  • Bonstra/librem5-devkit-tools
  • yogo1212/librem5-devkit-tools
  • martin.kepplinger/librem5-devkit-tools
  • craftyguy/librem5-devkit-tools
  • david.boddie/librem5-devkit-tools
  • sebastian.krzyszkowiak/librem5-devkit-tools
  • fuzzy7k/librem5-devkit-tools
  • david.hamner/librem5-devkit-tools
  • evangelos.tzaras/librem5-devkit-tools
  • joao.azevedo/librem5-devkit-tools
  • eric.kuzmenko/librem5-devkit-tools
23 results
Show changes
Commits on Source (47)
Showing
with 257 additions and 55 deletions
......@@ -14,7 +14,7 @@ We have [pytest][] based tests to validate that the kernel probed the
hardware correctly. See the individual files in `pytests/`.
To run the tests from the source tree use:
sudo pytest-3
sudo pytest-3 pytests/
in the toplevel source directory. You can use *pytests* matching to only run
ceratain tests you're interested in. The tests are built into a Debian package
......
librem5-devkit-tools (0.0.28pureos1) byzantium; urgency=medium
[ Angus Ainslie ]
* librem5-devkit.conf: there's a compass app so enable the magnetometer
* pytests/test_magn.py: don't modprobe the module
* write_flash: convert the bash srcipt to python
[ Martin Kepplinger ]
* pytests: update status_led test for the multicolor sysfs ABI
* pytests: fix battery charger sysfs path
-- Martin Kepplinger <martin.kepplinger@puri.sm> Tue, 20 Jun 2023 14:30:43 +0200
librem5-devkit-tools (0.0.27pureos1) byzantium; urgency=medium
[ Dorota Czaplejewicz ]
* cameras: Add test for test pattern
[ Angus Ainslie ]
* resize_rootfs: cryptsetup needs a passphrase now
* resize-l5-128GB-root-part.lst: for the 128GB phones
[ Sebastian Krzyszkowiak ]
* resize_roots: Don't try to pass empty passphrase to cryptsetup
* resize_rootfs.service: Pass the default passphrase to the script
* resize_rootfs: Move sentinel checking to systemd service
-- Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Sat, 11 Mar 2023 00:42:29 +0100
librem5-devkit-tools (0.0.26pureos1) byzantium; urgency=medium
[ Martin Kepplinger ]
* pytests: add test that evaluates front sensor's test pattern
* pytests: update regulator test to v6.0 based kernels
[ Dorota Czaplejewicz ]
* pytests: Use correct address for birch
[ Guido Günther ]
* Make flake8 happy
-- Martin Kepplinger <martin.kepplinger@puri.sm> Tue, 10 Jan 2023 12:52:00 +0100
librem5-devkit-tools (0.0.25pureos1) byzantium; urgency=medium
[ Evangelos Ribeiro Tzaras ]
* Avoid printing to stderr on package upgrade
* d/control: Fix typo
[ Guido Günther ]
* README: Fix test invocation
* d/control: Build depend on pyudev
* pytests: test_audio: Test that the modem has the correct tag
[ Angus Ainslie ]
* scripts/write_flash.sh: add an offset for the write
[ Martin Kepplinger ]
* pytests: fix panel_brightness test for evergreen
* pytests: add a test for system suspend using rtcwake
[ Sebastian Krzyszkowiak ]
* uuu_scripts: boot_kernel_version: Don't unzip the kernel image
* uuu_scripts: boot_kernel_version: Remove "root" attribute from cmdline
-- Martin Kepplinger <martin.kepplinger@puri.sm> Tue, 21 Jun 2022 08:57:54 +0200
librem5-devkit-tools (0.0.24pureos1) byzantium; urgency=medium
[ Martin Kepplinger ]
* test_cameras: update for newer kernels
[ Guido Günther ]
* pytests: Add initial test for tps6598x
-- Martin Kepplinger <martin.kepplinger@puri.sm> Mon, 07 Feb 2022 10:10:08 +0100
librem5-devkit-tools (0.0.23pureos1) byznatium; urgency=medium
[ Martin Kepplinger ]
* modprobe.d: add setting for redpine rf tx/rx power modes
-- Martin Kepplinger <martin.kepplinger@puri.sm> Fri, 19 Nov 2021 08:50:44 +0100
librem5-devkit-tools (0.0.22pureos1) byzantium; urgency=medium
[ Guido Günther ]
* pytests: Make sound card names match upstream
* Drop flashing scripts (Closes: #40)
* uuu_scripts: Add helper to flash MBR with resized root partion
[ Martin Kepplinger ]
* test_audio: fix sound output for the phone
* test_touch: update the test for evergreen
-- Martin Kepplinger <martin.kepplinger@puri.sm> Mon, 11 Oct 2021 16:23:27 +0200
librem5-devkit-tools (0.0.21pureos1) byzantium; urgency=high
* resize_rootfs: Resize underlying luks device as well if possible
-- Guido Günther <agx@sigxcpu.org> Fri, 03 Sep 2021 13:31:42 +0200
librem5-devkit-tools (0.0.20pureos1) byzantium; urgency=medium
[ Guido Günther ]
* Drop passwordless sudo
See: https://source.puri.sm/Librem5/OS-issues/-/issues/208
[ Dorota Czaplejewicz ]
* USB gadget: Drop g_multi
This moved to librem5-base
-- Guido Günther <agx@sigxcpu.org> Fri, 27 Aug 2021 16:08:45 +0200
librem5-devkit-tools (0.0.19pureos1) byzantium; urgency=medium
* d/control: Depend on librem5-flash-image
......
......@@ -33,7 +33,7 @@ Breaks: wys (<< 0.1.1),
librem5-base-defaults (<< 19),
Description: Basic configuration for the librem5-devkit
This package contains initial configuration for the
librem5 devkits.
Librem5 devkits.
Package: librem5-check
Architecture: all
......@@ -52,6 +52,7 @@ Depends:
python3-pytest,
python3-evdev,
python3-nmea2,
python3-pyudev,
python3-yaml,
usb-modeswitch,
usbutils,
......
......@@ -21,8 +21,12 @@ case "$1" in
configure)
# Enable serial console over USB
systemctl enable serial-getty@ttyGS0
# Mass storage is required for Ethernet+serial over USB via g_multi
truncate -s 1M /var/lib/mass_storage_dummy
# Mass storage is no longer required for Ethernet+serial over USB via g_multi
if [ -f /var/lib/mass_storage_dummy ] && \
md5sum /var/lib/mass_storage_dummy | grep -qs '^b6d81b360a5672d80c27430f39153e2c '; then
rm /var/lib/mass_storage_dummy
fi
if [ -z "$2" ]; then
echo "Initial install, linking shipment script"
......
[Unit]
Description=Performs an online resize of an ext2,3,4 rootfs
After=-.mount
ConditionPathExists=!/etc/resize_rootfs-resized
[Service]
Type=oneshot
ExecStart=/usr/bin/resize_rootfs
ExecStart=/usr/bin/resize_rootfs 123456
[Install]
WantedBy=local-fs.target
options g_multi file=/var/lib/mass_storage_dummy stall=0
# blacklist mainline driver (rsi):
blacklist rsi_91x
blacklist rsi_sdio
......@@ -9,9 +7,6 @@ options rsi_sdio dev_oper_mode=5
# blacklist vendor driver (redpine):
# blacklist redpine_91x
# blacklist redpine_sdio
options redpine_91x dev_oper_mode=5 rsi_zone_enabled=1 antenna_diversity=1
# blacklist magnetometer as long as we don't use it
blacklist st_magn
blacklist st_magn_i2c
blacklist st_magn_spi
# wlan_rf_power_mode values: 0x00 default, 0x11 medium, 0x22 low power
options redpine_91x dev_oper_mode=5 rsi_zone_enabled=1 antenna_diversity=1 wlan_rf_power_mode=0x00
# Serial console and Ethernet over USB (plus dummy mass storage)
g_multi
# Make it simple to blink leds
ledtrig-timer
......@@ -11,6 +11,10 @@ def is_birch():
return _get_board_type() == 'Purism Librem 5r2'
def is_evergreen():
return _get_board_type() == 'Purism Librem 5r4'
def is_librem5():
return r'Purism Librem 5r' in _get_board_type()
......
......@@ -2,6 +2,7 @@ from . import boardtype
import os
import pytest
import pyudev
import subprocess
......@@ -16,19 +17,19 @@ def tempdir():
def test_sgtl5000():
"Check if the sgtl5000 audio codec is there"
out = subprocess.check_output(["aplay", "-l"])
assert b"[sgtl5000]" in out
assert b"[Librem 5 Devkit]" in out
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_wm8962():
"Check if the audio codec is there"
out = subprocess.check_output(["aplay", "-l"])
assert b"[wm8962]" in out
assert b"[Librem 5]" in out
def test_codec_and_modem_cards_exist():
assert(os.path.exists('/sys/class/sound/card0'))
assert(os.path.exists('/sys/class/sound/card1'))
assert (os.path.exists('/sys/class/sound/card0'))
assert (os.path.exists('/sys/class/sound/card1'))
def test_headphone_detection():
......@@ -40,9 +41,9 @@ def test_headphone_detection():
def test_sound_output(tempdir):
if boardtype.is_librem5():
output = 'wm8962'
output = 'L5'
else:
output = 'sgtl5000'
output = 'Devkit'
out = subprocess.run(["alsabat",
"-D",
"plughw:CARD={},DEV=0".format(output),
......@@ -52,5 +53,15 @@ def test_sound_output(tempdir):
os.path.join(tempdir, 'default_dual.wav'),
"--standalone"],
capture_output=True)
assert(b"Return value is 0" in out.stdout)
assert(out.returncode == 0)
assert (b"Return value is 0" in out.stdout)
assert (out.returncode == 0)
def test_modem_udev_tag():
"""Check that the modem got tagged correctly"""
found = False
context = pyudev.Context()
for m in context.list_devices(subsystem='sound', SOUND_CLASS='modem'):
assert (m.sys_path.startswith('/sys/devices/platform/sound-wwan/sound'))
found = True
assert (found is True)
def test_battery_charger():
assert("Good" in open("/sys/class/power_supply/bq25890-charger/health").read())
assert ("Good" in open("/sys/class/power_supply/bq25890-charger-0/health").read())
import subprocess
def test_csi():
out = subprocess.check_output(['v4l2-ctl', '-D', '-d', '/dev/video0'])
assert(b'i.MX6S_CSI' in out)
assert(b"\tVideo Capture" in out)
assert(b"\tStreaming" in out)
import subprocess
from . import boardtype
def test_front():
out = subprocess.check_output(['v4l2-ctl', '--media-bus-info', 'platform:30a90000.csi', '--device', 'hi846 2-0020', '--all'])
assert (b"analogue_gain" in out)
def test_rear():
address = '10' if boardtype.is_birch() else '2d'
out = subprocess.check_output(['v4l2-ctl', '--media-bus-info', 'platform:30b80000.csi', '--device', 's5k3l6xx 3-00' + address, '--all'])
assert (b"analogue_gain" in out)
......@@ -35,7 +35,7 @@ def test_selfie_camera_i2c():
'-f', # don't let the loaded driver prevent the test
'-y', '2',
'w2@0x20', '0x0f', '0x16', 'r2'])
assert(readout == b'0x46 0x08\n')
assert (readout == b'0x46 0x08\n')
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
......@@ -47,7 +47,7 @@ def test_big_camera_i2c():
'-f', # don't let the loaded driver prevent the test
'-y', '3',
'w2@' + address, '0x00', '0x00', 'r2'])
assert(readout == b'0x30 0xc6\n')
assert (readout == b'0x30 0xc6\n')
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
......@@ -67,11 +67,11 @@ def test_big_camera_focus_driver():
with power_up():
# Set config bits.
readout = regsetread('0x00', '0x0f')
assert(readout == b'0x00 0x0f\n')
assert (readout == b'0x00 0x0f\n')
# Switch to "Ringing setting" mode,
# which probably means "Change settings".
readout = regsetread('0xec', '0xa3')
assert(readout == b'0x00 0x00\n')
assert (readout == b'0x00 0x00\n')
# Switch back to drive mode.
readout = regsetread('0xdc', '0x51')
assert(readout == b'0x00 0x0f\n')
assert (readout == b'0x00 0x0f\n')
import shlex
import subprocess
import tempfile
def test_front():
try:
subprocess.check_call(['media-ctl', '-d', 'platform:30a90000.csi', '--set-v4l2', "\'csi\':0 [fmt:SGBRG10/1632x1224 colorspace:raw]"])
subprocess.check_call(['media-ctl', '-d', 'platform:30a90000.csi', '--set-v4l2', "\'imx8mq-mipi-csi2 30a70000.csi\':0 [fmt:SGBRG10/1632x1224 colorspace:raw]"])
subprocess.check_call(['media-ctl', '-d', 'platform:30a90000.csi', '--set-v4l2', "\'hi846 2-0020\':0 [fmt:SGBRG10/1632x1224 colorspace:raw]"])
subprocess.check_call(['media-ctl', '-d', 'platform:30a90000.csi', '-l', "\'hi846 2-0020\':0 -> \'imx8mq-mipi-csi2 30a70000.csi\':0 [1]"])
except subprocess.CalledProcessError as e:
raise RuntimeError("media-ctl error: %s " % (e.returncode))
try:
subprocess.check_call(['v4l2-ctl', '--media-bus-info', 'platform:30a90000.csi', '--device', 'hi846 2-0020', '--set-ctrl=test_pattern=1'])
except subprocess.CalledProcessError as e:
raise RuntimeError("v4l2-ctl sensor setting error: %s " % (e.returncode))
temp = tempfile.NamedTemporaryFile()
hi846_format = ''
if int(subprocess.getoutput('uname -r').split('.')[0]) >= 6:
hi846_format = 'GB10'
else:
hi846_format = 'GB16'
command = ('v4l2-ctl', '-d', "/dev/v4l/by-path/platform-30a90000.csi-video-index0", "--set-fmt-video=width=1632,height=1224,pixelformat=%s" % hi846_format, '--stream-mmap', '--stream-skip=3', '--stream-count=1', "--stream-to=%s" % temp.name)
comp_data = bytearray([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
try:
subprocess.check_call(command)
except subprocess.CalledProcessError as e:
subprocess.check_call(['v4l2-ctl', '--media-bus-info', 'platform:30a90000.csi', '--device', 'hi846 2-0020', '--set-ctrl=test_pattern=0'])
raise RuntimeError("v4l2-ctl streaming error: %s " % (e.returncode))
subprocess.check_call(['v4l2-ctl', '--media-bus-info', 'platform:30a90000.csi', '--device', 'hi846 2-0020', '--set-ctrl=test_pattern=0'])
file = open("%s" % temp.name, "rb")
assert(comp_data in file.read(30))
file.close()
def test_big():
def call(cmd):
return subprocess.check_call(shlex.split(cmd))
try:
call('''media-ctl -d "platform:30b80000.csi" --entity "csi" --set-v4l2 "'csi':0 [fmt:SGRBG8/1052x780 colorspace:raw]"''')
call('''media-ctl -d "platform:30b80000.csi" --entity "csi" --set-v4l2 "'imx8mq-mipi-csi2 30b60000.csi':0 [fmt:SGRBG8/1052x780 colorspace:raw]"''')
call('''media-ctl -d "platform:30b80000.csi" --entity "csi" --set-v4l2 "'s5k3l6xx 3-002d':0 [fmt:SGRBG8/1052x780 colorspace:raw]"''')
call('''media-ctl -d "platform:30b80000.csi" -l "'s5k3l6xx 3-002d':0 -> 'imx8mq-mipi-csi2 30b60000.csi':0 [1]"''')
except subprocess.CalledProcessError as e:
raise RuntimeError("media-ctl error: %s " % (e.returncode))
try:
# gray test pttern
call('''v4l2-ctl --media-bus-info platform:30b80000.csi --device 's5k3l6xx 3-002d' --set-ctrl=test_pattern=5''')
except subprocess.CalledProcessError as e:
raise RuntimeError("v4l2-ctl sensor setting error: %s " % (e.returncode))
try:
with tempfile.NamedTemporaryFile(mode='rb') as tempf:
call('''v4l2-ctl --device="/dev/v4l/by-path/platform-30b80000.csi-video-index0" --set-fmt-video=width=1052,height=780,pixelformat=GRBG --stream-mmap --stream-skip=3 --stream-count=1 --stream-to={}'''.format(tempf.name))
comp_data = bytearray([0x10] * 0xc8550)
assert(comp_data == tempf.read())
except subprocess.CalledProcessError as e:
raise RuntimeError("v4l2-ctl streaming error: %s " % (e.returncode))
finally:
call('''v4l2-ctl --media-bus-info platform:30b80000.csi --device 's5k3l6xx 3-002d' --set-ctrl=test_pattern=0''')
......@@ -3,15 +3,15 @@ import os
def test_cpufreq_dt():
"Ensure cpufreq dt platform driver is present"
assert(os.path.exists('/sys/devices/platform/imx-cpufreq-dt'))
assert (os.path.exists('/sys/devices/platform/imx-cpufreq-dt'))
def test_cpufreq():
assert("1000000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq").read())
assert("1000000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq").read())
assert("1000000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_min_freq").read())
assert("1000000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_min_freq").read())
assert("1500000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq").read())
assert("1500000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq").read())
assert("1500000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq").read())
assert("1500000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq").read())
assert ("1000000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq").read())
assert ("1000000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq").read())
assert ("1000000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_min_freq").read())
assert ("1000000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_min_freq").read())
assert ("1500000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq").read())
assert ("1500000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq").read())
assert ("1500000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq").read())
assert ("1500000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq").read())
def test_cpuidle():
assert("WFI\n" == open("/sys/devices/system/cpu/cpu0/cpuidle/state0/name").read())
assert("cpu-sleep\n" == open("/sys/devices/system/cpu/cpu0/cpuidle/state1/name").read())
assert ("WFI\n" == open("/sys/devices/system/cpu/cpu0/cpuidle/state0/name").read())
assert ("cpu-sleep\n" == open("/sys/devices/system/cpu/cpu0/cpuidle/state1/name").read())
......@@ -3,9 +3,9 @@ import os
def test_devfreq_ddr():
"Ensure ddr devfreq driver is present"
assert(os.path.exists('/sys/class/devfreq/3d400000.memory-controller'))
assert (os.path.exists('/sys/class/devfreq/3d400000.memory-controller'))
def test_devfreq_freq():
assert("25000000" in open("/sys/class/devfreq/3d400000.memory-controller/min_freq").read())
assert("800000000" in open("/sys/class/devfreq/3d400000.memory-controller/max_freq").read())
assert ("25000000" in open("/sys/class/devfreq/3d400000.memory-controller/min_freq").read())
assert ("800000000" in open("/sys/class/devfreq/3d400000.memory-controller/max_freq").read())
......@@ -17,10 +17,10 @@ def udev_props(path):
def test_render_node():
"Test if we have a render node"
assert(os.path.exists(NODE))
assert (os.path.exists(NODE))
def test_etnaviv_node():
"Test if the render node is etnaviv"
props = udev_props(NODE)
assert(props['ID_PATH'] == 'platform-etnaviv')
assert (props['ID_PATH'] == 'platform-etnaviv')
......@@ -6,4 +6,4 @@ import pytest
@pytest.mark.skipif(not boardtype.is_librem5(), reason="Not a phone")
def test_gnss_exists():
assert(os.path.exists('/dev/gnss0'))
assert (os.path.exists('/dev/gnss0'))
......@@ -4,4 +4,4 @@ import evdev
def test_gpio_keys():
"Test if we have a evdev named 'gpio-keys'"
devices = [evdev.InputDevice(path).name for path in evdev.list_devices()]
assert("gpio-keys" in devices)
assert ("gpio-keys" in devices)