# RCI testing script to check task creation and execution on CPU 0 only
#
confirm
create arb1 0
create arb2 0
create arb3 0
rate 2000 0 arb1
rate 2000 200 arb2
rate 2000 400 arb3
scheduling arb1 ON_CLOCK
scheduling arb2 ON_CLOCK
scheduling arb3 ON_CLOCK
control cfxn1 arb1 10
control cfxn1 arb2 20
control cfxn1 arb3 30
#
# This first part of the script will check basic task execution on each
# CPU.
confirm
start ff
# the consoles should be printing 3 tasks each
confirm
release ff
# now all tasks should be released
astRate arb1 1500
start 12
# tasks 1 and 4  should be operation, along with an AST running at a 1500
# msec. interval
confirm
release 12
astRate arb1 0
#
# The next part of the script will check the basic timeout mechanism
confirm
wakeupFxn arb1 null
scheduling arb1 ON_FUNCTION
timeout arb1 2 -1 -1
start 2
# task 1 should time out in about 4 seconds
confirm
release 2
timeout arb1 5 -1 -1
start 2
# task 1 should time out in about 10 seconds
confirm
release 2
timeout arb1 0 -1 -1
start 2
# task 1 should not time out
confirm
release 2
#
# The last part of the script will check the ON_SIGNAL scheduling
confirm
scheduling arb1 ON_SIGNAL SIGUSR1
scheduling arb2 ON_SIGNAL SIGUSR2
scheduling arb3 ON_SIGNAL SIGUSR1
signal SIGUSR1

# Nothing should have been printed
confirm
start e
signal SIGUSR1

# tasks 1 and 3 should have each executed once
confirm
signal SIGUSR2
signal SIGUSR1
signal SIGUSR2
signal SIGUSR2
signal SIGUSR1
signal SIGUSR1
signal SIGUSR2
# the following sequence of tasks should have been executed:
# task 2, task 1 and 3, task 2, task 2, task 1 and 3, task 1 and 3, task 2
confirm
release 8
signal SIGUSR2
signal SIGUSR1
signal SIGUSR2
# the following sequence of tasks should have been executed:
# task 2, task 1, task 2
confirm
release e
signal SIGUSR2
signal SIGUSR1
# no tasks should have been executed
confirm
scheduling arb1 ON_CLOCK
signal SIGUSR2
signal SIGUSR1
# nothing should have been printed as a result of the last two signals
confirm
scheduling arb2 ON_CLOCK
signal SIGUSR1
signal SIGUSR2
# 'default handler for SIGUSR2' should have been printed
confirm
scheduling arb3 ON_CLOCK
signal SIGUSR1
signal SIGUSR2
# 'default handler for SIGUSR1' and 'default handler for SIGUSR2' should
# have been printed
confirm
