remove native 'snprintf' calls, improve test coverage

- Replace all native 'snprintf' calls with 'Genode::String'.
- Fix ram quotas and libc configs in effected run scripts.
- Verify bit-perfect output of lz_rom test with rom_verify.

Fix #72
This commit is contained in:
Emery Hemingway
2017-04-20 09:15:17 -05:00
committed by Norman Feske
parent 78046dfd66
commit a44aa90660
10 changed files with 71 additions and 68 deletions

View File

@@ -63,9 +63,8 @@ set config {
<binary name="test-libc"/>
<resource name="RAM" quantum="4M"/>
<config>
<libc stdout="/log">
<vfs> <fs/> </vfs>
</libc>
<libc stdout="/log"/>
<vfs> <fs/> </vfs>
</config>
<route>
<any-service>
@@ -78,9 +77,8 @@ set config {
<binary name="test-libc"/>
<resource name="RAM" quantum="4M"/>
<config>
<libc stdout="/log">
<vfs> <fs/> </vfs>
</libc>
<libc stdout="/log"/>
<vfs> <fs/> </vfs>
</config>
<route>
<any-service>
@@ -93,9 +91,8 @@ set config {
<binary name="test-libc"/>
<resource name="RAM" quantum="4M"/>
<config>
<libc stdout="/log">
<vfs> <fs/> </vfs>
</libc>
<libc stdout="/log"/>
<vfs> <fs/> </vfs>
</config>
<route>
<any-service>

View File

@@ -1,12 +1,16 @@
build "core init server/log_tee test/printf"
build "core init server/log_tee test/log"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RAM"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
@@ -17,7 +21,7 @@ install_config {
<provides> <service name="LOG"/> </provides>
</start>
<start name="test-printf">
<start name="test-log">
<resource name="RAM" quantum="2M"/>
<route>
<any-service> <child name="log_tee"/> <parent/> </any-service>
@@ -26,8 +30,8 @@ install_config {
</config>
}
build_boot_image "core ld.lib.so init log_tee test-printf"
build_boot_image "core ld.lib.so init log_tee test-log"
append qemu_args "-nographic -m 64"
run_genode_until {child "test-printf" exited with exit value 0} 10
run_genode_until {\[test-log\] Test done.} 10

View File

@@ -1,9 +1,12 @@
set sha256sum [check_installed sha256sum]
build {
core init
drivers/timer
lib/libc_noux
noux-pkg/coreutils
noux/minimal
proxy/rom_verify
server/log_terminal
server/lz_rom
}
@@ -12,9 +15,12 @@ build {
exec sh -c "[cross_dev_prefix]strip bin/coreutils/bin/*"
exec tar cfv bin/coreutils.tar -h -C bin/coreutils .
# get the hash of the tarball to check against after decompression
set tar_digest [lindex [exec $sha256sum bin/coreutils.tar] 0]
create_boot_directory
install_config {
append config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
@@ -47,6 +53,19 @@ install_config {
<libc/>
</config>
</start>
<start name="rom_verify">
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> </provides>
<config>}
append config "<policy label_suffix=\"coreutils.tar\" sha256=\"$tar_digest\"/>"
append config {
</config>
<route>
<service name="ROM" label_suffix="coreutils.tar">
<child name="lz_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="noux">
<resource name="RAM" quantum="32M"/>
<config verbose="yes">
@@ -55,7 +74,7 @@ install_config {
</config>
<route>
<service name="ROM" label="coreutils.tar">
<child name="lz_rom"/> </service>
<child name="rom_verify"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
@@ -63,6 +82,8 @@ install_config {
</config>
}
install_config $config
# Lzip the coreutils tarball
exec lzip --force --keep bin/coreutils.tar
@@ -78,6 +99,8 @@ build_boot_image {
log_terminal
lz_rom
noux
rom_verify
stdcxx.lib.so
timer
}

View File

@@ -63,9 +63,8 @@ append config {
<start name="test-libc">
<resource name="RAM" quantum="8M"/>
<config>
<libc stdout="/log" stderr="log">
<vfs> <log/> </vfs>
</libc>
<libc stdout="/log" stderr="log"/>
<vfs> <log/> </vfs>
</config>
</start>

View File

@@ -15,8 +15,8 @@ create_boot_directory
set sha256sum [check_installed sha256sum]
set rom_file bin/test-log
set test_digest [exec $sha256sum $rom_file]
set ld_digest [lindex [exec $sha256sum bin/ld-linux.lib.so] 0]
set test_digest [lindex [exec $sha256sum bin/test-log] 0]
append config {
<config>
@@ -35,36 +35,21 @@ append config {
<any-service><parent/><any-child/></any-service>
</default-route>
<start name="rom_verify">
<resource name="RAM" quantum="1M"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> </provides>
<config>}
append config "<policy label=\"init -> test-log\" sha256=\"$test_digest\"/>"
append config "<policy label=\"ld.lib.so\" sha256=\"$ld_digest\"/>"
append config "<policy label=\"test-log\" sha256=\"$test_digest\"/>"
append config {
</config>
</start>
<start name="init" verbose="yes">
<resource name="RAM" quantum="2M"/>
<start name="test-log">
<resource name="RAM" quantum="1M"/>
<route>
<service name="ROM" label_suffix="test-log">
<service name="ROM">
<child name="rom_verify"/> </service>
<any-service>
<parent/>
</any-service>
<any-service> <parent/> </any-service>
</route>
<config>
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RAM"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<start name="test-log">
<resource name="RAM" quantum="1M"/>
<route> <any-service> <parent/> </any-service> </route>
</start>
</config>
</start>
</config>
}