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
895af0a6
Commit
895af0a6
authored
Jan 11, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a feature test "term" for having a adm3a term{info|cap} entry
parent
ddc11003
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
vtc.c
bin/varnishtest/vtc.c
+21
-0
vtc_process.c
bin/varnishtest/vtc_process.c
+2
-3
No files found.
bin/varnishtest/vtc.c
View file @
895af0a6
...
...
@@ -712,12 +712,32 @@ cmd_delay(CMD_ARGS)
* ignore_unknown_macro
* Do not fail the test if a string of the form ${...} is not
* recognized as a macro.
* term
* Support for ADM3A terminal
*
* Be careful with the last feature, because it may cause a test with a
* misspelled macro to fail silently. You should only need it if you must
* run a test with strings of the form "${...}".
*/
static
int
test_term
(
struct
vtclog
*
vl
)
{
FILE
*
p
;
int
a
,
b
,
c
;
p
=
popen
(
"tput -T adm3a clear 2>&1"
,
"r"
);
if
(
p
==
NULL
)
return
(
0
);
a
=
fgetc
(
p
);
b
=
fgetc
(
p
);
c
=
pclose
(
p
);
if
(
a
==
0x1a
&&
b
==
EOF
&&
c
==
0
)
return
(
1
);
vtc_log
(
vl
,
3
,
"No adm3a terminfo entry. (insteall ncurses-term ?)"
);
return
(
0
);
}
static
void
cmd_feature
(
CMD_ARGS
)
{
...
...
@@ -766,6 +786,7 @@ cmd_feature(CMD_ARGS)
FEATURE
(
"user_varnish"
,
getpwnam
(
"varnish"
)
!=
NULL
);
FEATURE
(
"user_vcache"
,
getpwnam
(
"vcache"
)
!=
NULL
);
FEATURE
(
"group_varnish"
,
getgrnam
(
"varnish"
)
!=
NULL
);
FEATURE
(
"term"
,
test_term
(
vl
));
if
(
!
strcmp
(
*
av
,
"disable_aslr"
))
{
good
=
1
;
...
...
bin/varnishtest/vtc_process.c
View file @
895af0a6
...
...
@@ -320,8 +320,7 @@ process_init_term(int fd)
tt
.
c_iflag
=
BRKINT
|
ICRNL
|
IMAXBEL
|
IXON
|
IXANY
;
tt
.
c_lflag
=
ICANON
|
ISIG
|
IEXTEN
;
tt
.
c_oflag
=
OPOST
|
ONLCR
;
cfsetispeed
(
&
tt
,
B9600
);
cfsetospeed
(
&
tt
,
B9600
);
AZ
(
cfsetspeed
(
&
tt
,
B9600
));
tt
.
c_cc
[
VEOF
]
=
'\x04'
;
// CTRL-D
tt
.
c_cc
[
VERASE
]
=
'\x08'
;
// CTRL-H (Backspace)
tt
.
c_cc
[
VKILL
]
=
'\x15'
;
// CTRL-U
...
...
@@ -365,7 +364,7 @@ process_start(struct process *p)
p
->
pid
=
fork
();
assert
(
p
->
pid
>=
0
);
if
(
p
->
pid
==
0
)
{
setenv
(
"TERM"
,
"adm3a"
,
1
);
AZ
(
setenv
(
"TERM"
,
"adm3a"
,
1
)
);
assert
(
dup2
(
slave
,
STDIN_FILENO
)
==
STDIN_FILENO
);
assert
(
dup2
(
slave
,
STDOUT_FILENO
)
==
STDOUT_FILENO
);
assert
(
dup2
(
fd2
[
1
],
STDERR_FILENO
)
==
STDERR_FILENO
);
...
...
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