Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2023.10 is OUT / Merge Window is OPEN, next branch is CLOSED / Release v2024.01 is scheduled for 08 January 2024 / Channel archives at https://libera.irclog.whitequark.org/u-boot
<ukky> how can I ensure that unit test is run in sandbox environmentt only? i.e. I want to fail the test on real HW
<ukky> found it, config SANDBOX
mmu_man has quit [Ping timeout: 255 seconds]
prabhakarlad has quit [Quit: Client closed]
mmu_man has joined #u-boot
jclsn has quit [Ping timeout: 260 seconds]
jclsn has joined #u-boot
<marex> ukky: why fail on real hw ?
<marex> real hardware also contains block devices
<ukky> marex: I would like to write a test case, but want to fail it on real HW as it actually screws up MBR record.
<marex> yes it does, use a throw-away drive then ?
<marex> or SD card or whatever
<marex> you do need to explicitly run the test anyway, so if you're concerned it corrupts a drive content, dont run it
<marex> I think the uboot-test-hooks already have something where you can specify which tests to skip
<marex> sjg1: ^
<ukky> we don't need a test case in this situation plus sandbox. On real HW we can just test with real 'mbr write' command, and then 'mbr verify'
<marex> ukky: the test should be identical and hardware independent, right ?
<ukky> imho, I was thinking about test case to test U-Boot code, not the real 'mbr write' functionality
<marex> have you had a look into test/cmd/ directory ?
<Forty-Bot> isn't there UT_TESTF_MANUAL
<marex> those tests invoke U-Boot commands (from code)
<ukky> 'mbr write' and 'mbr verify' are fully functional commands
<Forty-Bot> but I guess that wouldn't be automatic on sandbox...
<marex> ukky: except they dont work if you feed them 4 partitions, so, not really fully functional, right ?
<marex> I think that's the testcase you want to write here
<ukky> marex: yes, I checked test/cmd directory to see how/where a test would fit
<ukky> my idea of a test: declare single MBR partition, then 'mbr write', then 'mbr verify' and expect 'success' after all commands
<ukky> then declare two MBR partitions and repeat the test.
<ukky> then three MBR partitions and repeat.
<marex> you can always 'mbr write' and then read the first block of disk into memory and dump it (or run crc32 on it and compare the crc)
<ukky> with four MBR partitions current U-Boot will fail
<marex> that way you only test one code path at a time (assuming crc works)
<marex> ukky: that's why you wanna test the 4 partition thing with a fix in place, so it never gets broken again
stefanro has joined #u-boot
<ukky> what should I call a test then? 'ut test_mmc_mbr_write'?
<marex> test/cmd/mbr.c and then define whatever sub-tests using UNIT_TEST(...) , see fdt.c for examples
<ukky> in sandbox, there are 3 MMC devices declared: mmc0: 1MiB, mmc1: NNNMiB, and mmc2: 1MiB. Can I access any of those. mmc1 seems like refers mmc1.img external file.
<marex> => mmc list
<marex> => mmc dev N
<ukky> yes, I know, but any of those are available for 'ut' command?
<marex> ut just runs commands and collects their output
<marex> there is little difference in that aspect
<marex> whatever you can run in shell, you can also run within ut
<marex> ut_assertok(run_command("fdt addr -c", 0));
<marex> like that ^ for example
<ukky> but there might be advantage, for example, of using mmc1, as you can actually see what was written in the test.
<Forty-Bot> use whichever one you want
<Forty-Bot> the other mmcs are just there to test partition name parsing support
mmu_man has quit [Ping timeout: 255 seconds]
Clamor has joined #u-boot
Furry has joined #u-boot
Clamor has quit [Ping timeout: 272 seconds]
qqq has joined #u-boot
Clamor has joined #u-boot
Furry has quit [Quit: Leaving]
monstr has joined #u-boot
monstr has quit [Remote host closed the connection]
gsz has joined #u-boot
monstr has joined #u-boot
persmule has joined #u-boot
persmule has quit [Remote host closed the connection]
persmule has joined #u-boot
monstr has quit [Ping timeout: 272 seconds]
qqq has quit [Ping timeout: 240 seconds]
qqq has joined #u-boot
matthias_bgg has joined #u-boot
Gravis has quit [Ping timeout: 240 seconds]
Gravis has joined #u-boot
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
ezulian has joined #u-boot
gsz has quit [Ping timeout: 255 seconds]
Clamor has quit [Read error: Connection reset by peer]
Clamor has joined #u-boot
deathcamel57_ has quit [Read error: Connection reset by peer]
deathcamel57 has joined #u-boot
monstr has joined #u-boot
sszy has joined #u-boot
monstr has quit [Ping timeout: 255 seconds]
monstr has joined #u-boot
prabhakarlad has joined #u-boot
mmu_man has joined #u-boot
sng has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
sng has joined #u-boot
f_ has joined #u-boot
mmu_man has quit [Ping timeout: 255 seconds]
persmule has quit [Remote host closed the connection]
davlefou has quit [Ping timeout: 258 seconds]
dsimic has quit [Ping timeout: 272 seconds]
dsimic has joined #u-boot
davlefou has joined #u-boot
gsz has joined #u-boot
Clamor has quit [Ping timeout: 255 seconds]
ezulian has quit [Quit: ezulian]
ezulian has joined #u-boot
Hypfer has quit [Quit: The Lounge - https://thelounge.github.io]
Hypfer has joined #u-boot
<sjg1> apalos: A script that brings in a subset of the source code would at least give us something to compare against
gsz has quit [Ping timeout: 255 seconds]
wyre has quit [Excess Flood]
alan_o has quit [Read error: Connection reset by peer]
alan_o has joined #u-boot
wyre has joined #u-boot
monstr has quit [Remote host closed the connection]
deathcamel57 has quit [Ping timeout: 255 seconds]
matthias_bgg has quit [Ping timeout: 258 seconds]
goliath has joined #u-boot
matthias_bgg has joined #u-boot
matthias_bgg has quit [Remote host closed the connection]
persmule has joined #u-boot
Stat_headcrabed has joined #u-boot
Stat_headcrabed has quit [Quit: Stat_headcrabed]
Stat_headcrabed has joined #u-boot
Stat_headcrabed has quit [Read error: Connection reset by peer]
Stat_headcrabed has joined #u-boot
Stat_headcrabed has quit [Quit: Stat_headcrabed]
stefanro has quit [Quit: Leaving.]
mmu_man has joined #u-boot
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
vagrantc has joined #u-boot
prabhakarlad has quit [Quit: Client closed]
prabhakarlad has joined #u-boot
mripard has quit [Quit: mripard]
goliath has quit [Quit: SIGSEGV]
ikarso has joined #u-boot
redbrain has quit [Ping timeout: 255 seconds]
redbrain has joined #u-boot
qsx has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
qsx has joined #u-boot
Leopold has quit [Quit: No Ping reply in 180 seconds.]
Leopold has joined #u-boot
flyback has quit [Ping timeout: 272 seconds]
qsx has quit [Ping timeout: 272 seconds]
qsx has joined #u-boot
ezulian has quit [Ping timeout: 258 seconds]
flyback has joined #u-boot
qqq has quit [Quit: leaving]
prabhakarlad has quit [Quit: Client closed]
gsz has joined #u-boot
flokli has quit [Quit: WeeChat 4.0.2]
flokli has joined #u-boot
f_ has quit [Ping timeout: 260 seconds]
gsz has quit [Ping timeout: 255 seconds]
goliath has joined #u-boot
mmu_man has quit [Ping timeout: 258 seconds]
mmu_man has joined #u-boot
goliath has quit [Quit: SIGSEGV]
goliath has joined #u-boot
justache is now known as justHaunting
ikarso has quit [Quit: Connection closed for inactivity]
mmu_man has quit [Ping timeout: 258 seconds]
goliath has quit [Quit: SIGSEGV]