Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
04e0ad4e
Unverified
Commit
04e0ad4e
authored
Jun 19, 2020
by
Christian Brauner
Committed by
Stéphane Graber
Jun 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: update terminology
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0332ef2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
console.c
src/tests/console.c
+12
-12
No files found.
src/tests/console.c
View file @
04e0ad4e
...
...
@@ -37,14 +37,14 @@
} while (0)
static
void
test_console_close_all
(
int
ttyfd
[
MAXCONSOLES
],
int
master
fd
[
MAXCONSOLES
])
int
ptmx
fd
[
MAXCONSOLES
])
{
int
i
;
for
(
i
=
0
;
i
<
MAXCONSOLES
;
i
++
)
{
if
(
master
fd
[
i
]
!=
-
1
)
{
close
(
master
fd
[
i
]);
master
fd
[
i
]
=
-
1
;
if
(
ptmx
fd
[
i
]
!=
-
1
)
{
close
(
ptmx
fd
[
i
]);
ptmx
fd
[
i
]
=
-
1
;
}
if
(
ttyfd
[
i
]
!=
-
1
)
{
...
...
@@ -59,14 +59,14 @@ static int test_console_running_container(struct lxc_container *c)
int
nrconsoles
,
i
,
ret
=
-
1
;
int
ttynum
[
MAXCONSOLES
];
int
ttyfd
[
MAXCONSOLES
];
int
master
fd
[
MAXCONSOLES
];
int
ptmx
fd
[
MAXCONSOLES
];
for
(
i
=
0
;
i
<
MAXCONSOLES
;
i
++
)
ttynum
[
i
]
=
ttyfd
[
i
]
=
master
fd
[
i
]
=
-
1
;
ttynum
[
i
]
=
ttyfd
[
i
]
=
ptmx
fd
[
i
]
=
-
1
;
ttynum
[
0
]
=
1
;
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
0
],
&
master
fd
[
0
]);
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
0
],
&
ptmx
fd
[
0
]);
if
(
ret
<
0
)
{
TSTERR
(
"console allocate failed"
);
goto
err1
;
...
...
@@ -79,12 +79,12 @@ static int test_console_running_container(struct lxc_container *c)
}
/* attempt to alloc same ttynum */
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
0
],
&
master
fd
[
1
]);
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
0
],
&
ptmx
fd
[
1
]);
if
(
ret
!=
-
1
)
{
TSTERR
(
"console allocate should fail for allocated ttynum %d"
,
ttynum
[
0
]);
goto
err2
;
}
close
(
masterfd
[
0
]);
master
fd
[
0
]
=
-
1
;
close
(
ptmxfd
[
0
]);
ptmx
fd
[
0
]
=
-
1
;
close
(
ttyfd
[
0
]);
ttyfd
[
0
]
=
-
1
;
/* ensure we can allocate all consoles, we do this a few times to
...
...
@@ -92,7 +92,7 @@ static int test_console_running_container(struct lxc_container *c)
*/
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
nrconsoles
=
0
;
nrconsoles
<
MAXCONSOLES
;
nrconsoles
++
)
{
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
nrconsoles
],
&
master
fd
[
nrconsoles
]);
ret
=
c
->
console_getfd
(
c
,
&
ttynum
[
nrconsoles
],
&
ptmx
fd
[
nrconsoles
]);
if
(
ret
<
0
)
break
;
ttyfd
[
nrconsoles
]
=
ret
;
...
...
@@ -103,13 +103,13 @@ static int test_console_running_container(struct lxc_container *c)
goto
err2
;
}
test_console_close_all
(
ttyfd
,
master
fd
);
test_console_close_all
(
ttyfd
,
ptmx
fd
);
}
ret
=
0
;
err2:
test_console_close_all
(
ttyfd
,
master
fd
);
test_console_close_all
(
ttyfd
,
ptmx
fd
);
err1:
return
ret
;
...
...
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