Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
ca4573d1
Commit
ca4573d1
authored
Oct 31, 2022
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental patch to send function-keys to vtc processes.
(May not work due to termcap/terminfo differences)
parent
b9751772
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
u00008.vtc
bin/varnishtest/tests/u00008.vtc
+21
-3
vtc_process.c
bin/varnishtest/vtc_process.c
+18
-0
No files found.
bin/varnishtest/tests/u00008.vtc
View file @
ca4573d1
...
...
@@ -11,9 +11,9 @@ varnish v1 -vcl+backend {
}
} -start
process p1
-dump
{varnishstat -n ${v1_name}} -start
process p2
-dump
{varnishstat -n ${v1_name}} -start
process p3
-dump
{varnishstat -n ${v1_name}} -start
process p1 {varnishstat -n ${v1_name}} -start
process p2 {varnishstat -n ${v1_name}} -start
process p3 {varnishstat -n ${v1_name}} -start
process p1 -expect-text 0 0 "VBE.vcl1.s1.happy"
process p1 -screen_dump
...
...
@@ -66,6 +66,24 @@ process p1 -winsz 25 132
process p1 -expect-text 4 124 "AVG_1000"
process p1 -expect-text 22 108 "UNSEEN DIAG"
process p1 -key NPAGE
process p1 -expect-text 0 0 "VBE.vcl1.s1.helddown"
process p1 -screen_dump
process p1 -key PPAGE
process p1 -expect-text 0 0 "VBE.vcl1.s1.happy"
process p1 -screen_dump
process p1 -key END
process p1 -expect-text 22 1 " "
process p1 -expect-text 4 1 "^^^"
process p1 -screen_dump
process p1 -key HOME
process p1 -expect-text 22 1 "vvv"
process p1 -expect-text 4 1 " "
process p1 -screen_dump
process p1 -screen_dump -write {q} -wait
process p2 -screen_dump -kill TERM -wait
process p3 -screen_dump -kill HUP -wait
bin/varnishtest/vtc_process.c
View file @
ca4573d1
...
...
@@ -964,6 +964,11 @@ process_close(struct process *p)
* expression from either output, consider using it if you only need
* to match one.
*
* \-key KEYSYM
* Send emulated key-press.
* KEYSYM can be one of (NPAGE, PPAGE, HOME, END)
*
*
* \-kill SIGNAL
* Send a signal to the process. The argument can be either
* the string "TERM", "INT", or "KILL" for SIGTERM, SIGINT or SIGKILL
...
...
@@ -1100,6 +1105,19 @@ cmd_process(CMD_ARGS)
p
->
log
=
3
;
continue
;
}
if
(
!
strcmp
(
*
av
,
"-key"
))
{
if
(
!
strcmp
(
av
[
1
],
"NPAGE"
))
process_write
(
p
,
"
\x1b\x5b\x36\x7e
"
);
else
if
(
!
strcmp
(
av
[
1
],
"PPAGE"
))
process_write
(
p
,
"
\x1b\x5b\x35\x7e
"
);
else
if
(
!
strcmp
(
av
[
1
],
"HOME"
))
process_write
(
p
,
"
\x1b\x4f\x48
"
);
else
if
(
!
strcmp
(
av
[
1
],
"END"
))
process_write
(
p
,
"
\x1b\x4f\x46
"
);
else
vtc_fatal
(
p
->
vl
,
"Unknown key %s"
,
av
[
1
]);
continue
;
}
if
(
!
strcmp
(
*
av
,
"-kill"
))
{
process_kill
(
p
,
av
[
1
]);
av
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment