Files
genode-world/run/python3.run
Norman Feske b3fb51eb6f Python3: avoid deprecated Xml_node methods
This commit also removes the dependency of the python3.run script from
the rtc driver to make it less hardware dependent.

Issue genodelabs/genode#3755
2020-05-12 17:27:57 +02:00

145 lines
3.2 KiB
Tcl

#
# \brief Test for running python
# \author Norman Feske
# \author Johannes Schlatow
# \date 2011-11-22
#
if {![have_spec x86]} {
puts "Run script is only supported on x86"; exit 0 }
proc depot_user {} { return [get_cmd_arg --depot-user local] }
create_boot_directory
import_from_depot [depot_user]/pkg/python3
#
# Build
#
build {
core init
timer
server/dynamic_rom
}
#
# Generate config
#
proc rtc_start_attr { } {
if {[have_spec linux]} { return {ld="no"} } else { return "" } }
install_config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="IO_PORT"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer" /></provides>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM" /> </provides>
<config>
<rom name="hello.py">
<inline>
print(" \r\n\r");
print(" -============================-");
print(" || ||");
print(" || Python Core 3 ||");
print(" || ||");
print(" || Genode 18.05 ||");
print(" || ||");
print(" -============================-");
print(" \r");
print(" 2018 by Genode Labs www.genode-labs.com");
print(" \r\n\r");
</inline>
<sleep milliseconds="4000" />
<inline>
print("Hello again")
</inline>
<sleep milliseconds="4000" />
</rom>
</config>
</start>
<start name="python3" caps="200">
<resource name="RAM" quantum="16M"/>
<route>
<service name="ROM" label="hello.py"> <child name="dynamic_rom" /> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
<config>
<pythonpath name="/python/Lib/:" />
<file name="hello.py" on-rom-update="hello.py" />
<vfs>
<dir name="dev">
<log/>
<jitterentropy name="urandom" />
<jitterentropy name="random" />
<inline name="rtc">2018-01-01 00:01</inline>
<zero/>
</dir>
<dir name="python">
<tar name="python3.tar" />
</dir>
<rom name="hello.py" />
</vfs>
<libc stdin="/dev/zero" stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
</config>
</start>
</config>}
#
# Boot modules
#
# generic modules
append boot_modules {
core init
ld.lib.so
timer
dynamic_rom
}
build_boot_image $boot_modules
#
# Execute test case
#
append qemu_args " -nographic "
run_genode_until {.*Hello again.*} 60
grep_output {python3\] }
compare_output_to {
[init -> python3]
[init -> python3] -============================-
[init -> python3] || ||
[init -> python3] || Python Core 3 ||
[init -> python3] || ||
[init -> python3] || Genode 18.05 ||
[init -> python3] || ||
[init -> python3] -============================-
[init -> python3]
[init -> python3] 2018 by Genode Labs www.genode-labs.com
[init -> python3]
}
# vi: set ft=tcl :