ports: refined noux_fork test
Thanks to the log_terminal server, we no longer rely on a separate UART for the noux output. We also skip the indirection of using a tar archive but rather start the test-noux_form program as a mounted ROM module.
This commit is contained in:
parent
fc6c2537ee
commit
f045b1c680
|
@ -1,13 +1,7 @@
|
||||||
if {[have_spec linux]} {
|
build {
|
||||||
puts "\nLinux not supported because of missing UART driver\n"
|
core init server/log_terminal noux/minimal lib/libc_noux test/noux_fork
|
||||||
exit 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build "core init drivers/timer drivers/uart noux/minimal lib/libc_noux test/noux_fork"
|
|
||||||
|
|
||||||
# create tar archive
|
|
||||||
exec tar cfv bin/noux_fork.tar -h -C bin test-noux_fork
|
|
||||||
|
|
||||||
create_boot_directory
|
create_boot_directory
|
||||||
|
|
||||||
install_config {
|
install_config {
|
||||||
|
@ -28,21 +22,14 @@ install_config {
|
||||||
<default-route>
|
<default-route>
|
||||||
<any-service> <any-child/> <parent/> </any-service>
|
<any-service> <any-child/> <parent/> </any-service>
|
||||||
</default-route>
|
</default-route>
|
||||||
<start name="timer">
|
<start name="log_terminal">
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Timer"/></provides>
|
|
||||||
</start>
|
|
||||||
<start name="uart_drv">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
<resource name="RAM" quantum="1M"/>
|
||||||
<provides><service name="Terminal"/></provides>
|
<provides><service name="Terminal"/></provides>
|
||||||
<config>
|
|
||||||
<policy label="noux" uart="1"/>
|
|
||||||
</config>
|
|
||||||
</start>
|
</start>
|
||||||
<start name="noux">
|
<start name="noux">
|
||||||
<resource name="RAM" quantum="1G"/>
|
<resource name="RAM" quantum="1G"/>
|
||||||
<config verbose="yes">
|
<config verbose="yes">
|
||||||
<fstab> <tar name="noux_fork.tar" /> </fstab>
|
<fstab> <rom name="test-noux_fork" /> </fstab>
|
||||||
<start name="test-noux_fork"> </start>
|
<start name="test-noux_fork"> </start>
|
||||||
</config>
|
</config>
|
||||||
</start>
|
</start>
|
||||||
|
@ -50,23 +37,10 @@ install_config {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_boot_image {
|
build_boot_image {
|
||||||
core init timer uart_drv ld.lib.so noux libc.lib.so
|
core init log_terminal noux ld.lib.so libc.lib.so libc_noux.lib.so
|
||||||
libc_noux.lib.so noux_fork.tar
|
test-noux_fork
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Redirect the output of Noux via the virtual serial port 1 into a file to be
|
|
||||||
# dumped after the successful completion of the test.
|
|
||||||
#
|
|
||||||
set noux_output_file "noux_output.log"
|
|
||||||
|
|
||||||
append qemu_args " -nographic "
|
append qemu_args " -nographic "
|
||||||
append qemu_args " -serial mon:stdio"
|
|
||||||
append qemu_args " -serial file:$noux_output_file"
|
|
||||||
|
|
||||||
run_genode_until "child.*exited.*\n" 20
|
run_genode_until "child.*exited.*\n" 20
|
||||||
|
|
||||||
puts "[exec cat $noux_output_file]"
|
|
||||||
|
|
||||||
exec rm bin/noux_fork.tar
|
|
||||||
exec rm $noux_output_file
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ enum { MAX_COUNT = 1000 };
|
||||||
|
|
||||||
int main(int, char **)
|
int main(int, char **)
|
||||||
{
|
{
|
||||||
int i = 0;
|
printf("--- test-noux_fork started ---\n");
|
||||||
|
|
||||||
pid_t fork_ret = fork();
|
pid_t fork_ret = fork();
|
||||||
if (fork_ret < 0) {
|
if (fork_ret < 0) {
|
||||||
|
@ -25,7 +25,7 @@ int main(int, char **)
|
||||||
if (fork_ret == 0) {
|
if (fork_ret == 0) {
|
||||||
printf("pid %d: child says hello\n", getpid());
|
printf("pid %d: child says hello\n", getpid());
|
||||||
for (int j = 0; j < MAX_COUNT; j++) {
|
for (int j = 0; j < MAX_COUNT; j++) {
|
||||||
printf("pid %d: child i = %d\n", getpid(), i);
|
printf("pid %d: child j = %d\n", getpid(), j);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ int main(int, char **)
|
||||||
printf("pid %d: parent received child pid %d, starts counting...\n",
|
printf("pid %d: parent received child pid %d, starts counting...\n",
|
||||||
getpid(), fork_ret);
|
getpid(), fork_ret);
|
||||||
|
|
||||||
for (; i < MAX_COUNT; ) {
|
for (int i = 0; i < MAX_COUNT; ) {
|
||||||
printf("pid %d: parent i = %d\n", getpid(), i++);
|
printf("pid %d: parent i = %d\n", getpid(), i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue