sys/fuchsia: Add cprng and vmo tests.

This commit adds two new tests for fuchsia. One tests a basic syscall
(zx_cprng_draw), and the other does multiple tests over a vmo.
This commit is contained in:
Marco Vanotti 2020-03-20 11:20:02 -07:00 committed by Dmitry Vyukov
parent 2c31c529a9
commit aa6c6a5572
3 changed files with 10 additions and 0 deletions

View File

@ -291,6 +291,9 @@ func parseProg(target *prog.Target, dir, filename string) (*prog.Prog, map[strin
"EINVAL": 22,
"ENOTTY": 25,
"EOPNOTSUPP": 95,
// Fuchsia specific errors.
"ZX_ERR_BAD_HANDLE": 11,
}
info := &ipc.ProgInfo{Calls: make([]ipc.CallInfo, len(p.Calls))}
for i, call := range p.Calls {

2
sys/fuchsia/test/cprng Normal file
View File

@ -0,0 +1,2 @@
zx_cprng_draw(&(0x7f0000000000/0x100), 0x100)
zx_cprng_draw(&(0x7f0000000000/0x1), 0x1)

5
sys/fuchsia/test/vmo Normal file
View File

@ -0,0 +1,5 @@
zx_vmo_create(0x100, 0x0, &AUTO=<r0=>0x0)
zx_vmo_write(r0, &AUTO="010101", 0x01, 0x4)
zx_handle_close(r0)
zx_vmo_write(r0, &AUTO="010101", 0x01, 0x4) # ZX_ERR_BAD_HANDLE
zx_handle_close(r0) # ZX_ERR_BAD_HANDLE