NAME==h
FILE=--
CMDS=!scripts/test-webserver.sh
EXPECT=<<EOF
0x000006a0
            ; [14] -r-x section size 594 named .text
            ;-- section..text:
            ;-- entry0:
            ;-- _start:
            0x000006a0      xor ebp, ebp
            0x000006a2      mov r9, rdx
            0x000006a5      pop rsi
            0x000006a6      mov rdx, rsp
            0x000006a9      and rsp, 0xfffffffffffffff0
            0x000006ad      push rax
            0x000006ae      push rsp
            ; 0x8f0
            0x000006af      lea r8, sym.__libc_csu_fini
            ; 0x880
            ; "AWAVA\x89\xffAUATL\x8d%\xfe\x04 "
            0x000006b6      lea rcx, sym.__libc_csu_init
            ; 0x81e
            0x000006bd      lea rdi, main
	<title>radare2 webui</title>
EOF
EXPECT_ERR=
RUN

NAME=r2 remote webserver two
FILE=--
CMDS=<<EOF
& !rarun2 timeout=3 daemon=1 system="r2 -N -e http.root=/404 -e http.port=9292 -c=h -qcq -"
sleep 1
=+ http://127.0.0.1:9292/cmd/
=
=0 ?e hello remote world
EOF
EXPECT=<<EOF
[1] !rarun2 timeout=3 daemon=1 system="r2 -N -e http.root=/404 -e http.port=9292 -c=h -qcq -"
0 fd:-1 http://127.0.0.1:9292/cmd/
hello remote world
EOF
EXPECT_ERR=<<EOF
ERROR: Cannot find http.root or http.homeroot
Starting http server...
open http://localhost:9292/
r2 -C http://localhost:9292/cmd/
r2 r2web://localhost:9292/cmd/
EOF
RUN
