Skip to content

Commit c873744

Browse files
authored
Merge pull request #4584 from kolyshkin/test-int-nits
Misc nits to tests/integration
2 parents 885f8f6 + a50e687 commit c873744

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

tests/integration/hooks_so.bats

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@ function teardown() {
2424

2525
@test "runc run (hooks library tests)" {
2626
# setup some dummy libs
27-
gcc -shared -Wl,-soname,librunc-hooks-create-runtime.so.1 -o "$HOOKLIBCR.1.0.0"
28-
gcc -shared -Wl,-soname,librunc-hooks-create-container.so.1 -o "$HOOKLIBCC.1.0.0"
27+
gcc -shared -Wl,-soname,"$HOOKLIBCR.1" -o "$HOOKLIBCR.1.0.0"
28+
gcc -shared -Wl,-soname,"$HOOKLIBCC.1" -o "$HOOKLIBCC.1.0.0"
2929

3030
bundle=$(pwd)
3131

3232
# To mount $HOOKLIBCR we need to do that in the container namespace
33-
create_runtime_hook=$(
34-
cat <<-EOF
35-
pid=\$(cat - | jq -r '.pid')
36-
touch "$LIBPATH/$HOOKLIBCR.1.0.0"
37-
nsenter -m \$ns -t \$pid mount --bind "$bundle/$HOOKLIBCR.1.0.0" "$LIBPATH/$HOOKLIBCR.1.0.0"
38-
EOF
39-
)
33+
create_runtime_hook="pid=\$(cat - | jq -r '.pid'); touch "$LIBPATH/$HOOKLIBCR.1.0.0" && \
34+
nsenter -m \$ns -t \$pid mount --bind "$bundle/$HOOKLIBCR.1.0.0" "$LIBPATH/$HOOKLIBCR.1.0.0""
4035

4136
create_container_hook="touch ./lib/$HOOKLIBCC.1.0.0 && mount --bind $bundle/$HOOKLIBCC.1.0.0 ./lib/$HOOKLIBCC.1.0.0"
4237

tests/integration/tty.bats

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ function teardown() {
153153
# make sure we're running
154154
testcontainer test_busybox running
155155

156-
tty_info_with_consize_size=$(
157-
cat <<EOF
156+
tty_info_with_consize_size='
158157
{
159158
"terminal": true,
160159
"consoleSize": {
@@ -167,9 +166,7 @@ function teardown() {
167166
"/bin/stty -a > /tmp/tty-info"
168167
],
169168
"cwd": "/"
170-
}
171-
EOF
172-
)
169+
}'
173170

174171
# Run the detached exec.
175172
runc exec -t --pid-file pid.txt -d --console-socket "$CONSOLE_SOCKET" -p <(echo "$tty_info_with_consize_size") test_busybox
@@ -179,17 +176,14 @@ EOF
179176
# Wait for the exec to finish.
180177
wait_pids_gone 100 0.5 "$(cat pid.txt)"
181178

182-
tty_info=$(
183-
cat <<EOF
179+
tty_info='
184180
{
185181
"args": [
186182
"/bin/cat",
187183
"/tmp/tty-info"
188184
],
189185
"cwd": "/"
190-
}
191-
EOF
192-
)
186+
}'
193187

194188
# run the exec
195189
runc exec -t -p <(echo "$tty_info") test_busybox

0 commit comments

Comments
 (0)