RPi-SysInfo

 view release on metacpan or  search on metacpan

t/25-raspi_config.t  view on Meta::CPAN

like raspi_config,       qr/core_freq/, "function includes vcgencmd data ok";

# --- the config.txt portion (path resolved by _config_file) -----------------

my $config_file = RPi::SysInfo::_config_file();

ok defined $config_file && -f $config_file,
    "_config_file() resolves to an existing config.txt ($config_file)";

# config.txt directives must be appended; every Pi config.txt carries at least
# one dtparam= or dtoverlay= line. (The old code read the wrong path on
# Bookworm+ and so never included these.)

like
    $sys->raspi_config,
    qr/^dt(?:param|overlay)=/m,
    "method includes config.txt directives";

like
    raspi_config,
    qr/^dt(?:param|overlay)=/m,
    "function includes config.txt directives";

# comment and blank lines from config.txt must be stripped

unlike raspi_config, qr/^\s*#/m, "config.txt comment lines are stripped";

done_testing();

t/55-board-fixtures.t  view on Meta::CPAN

    like $details, qr/\QRaspberry Pi\E/,          "[$board] pi_details has the model name";
    like $details, qr/Throttled flag\s*:/,        "[$board] pi_details has the throttled flag";
    like $details, qr/Board\s*:\s*\Q$cfg->{model}\E/, "[$board] pi_details Board line = pi_model";
    like $details, qr/\Q$cfg->{soc}\E/,           "[$board] pi_details includes decoded SoC";
    like $details, $cfg->{camera_re},             "[$board] pi_details camera status ($cfg->{camera_re})";

    # --- raspi_config --------------------------------------------------------

    my $config = raspi_config();
    like   $config, qr/arm_freq/,            "[$board] raspi_config has vcgencmd config";
    like   $config, qr/^dt(?:param|overlay)=/m, "[$board] raspi_config appends config.txt directives";
    unlike $config, qr/^\s*#/m,              "[$board] raspi_config strips comment lines";

    # --- network_info --------------------------------------------------------

    like network_info(), qr/inet\b/, "[$board] network_info has inet data (via $cfg->{net_tool})";

    # --- file_system ---------------------------------------------------------

    my $fs = file_system();
    like $fs, qr/Filesystem .* Mounted on/, "[$board] file_system has df header";

t/data/pi3/config-str  view on Meta::CPAN

device_tree=-
overlay_prefix=overlays/

t/data/pi3/config-txt  view on Meta::CPAN

dtparam=audio=on
dtoverlay=vc4-kms-v3d
enable_uart=1

t/data/pi4/config-str  view on Meta::CPAN

device_tree=-
overlay_prefix=overlays/

t/data/pi4/config-txt  view on Meta::CPAN

dtparam=audio=on
dtoverlay=vc4-kms-v3d
camera_auto_detect=1
arm_64bit=1

t/data/pi5/config-str  view on Meta::CPAN

device_tree=-
overlay_prefix=overlays/
hdmi_cvt:0=

t/data/pi5/config-txt  view on Meta::CPAN

dtparam=i2c_arm=off
dtparam=spi=off
dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
disable_fw_kms_setup=1
arm_64bit=1
disable_overscan=1
arm_boost=1
[cm4]
otg_mode=1
[cm5]
dtoverlay=dwc2,dr_mode=host
[all]



( run in 2.159 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )