-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --host and -H as equivalent options to --url #14947
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,4 +400,23 @@ EOF | |
run_podman rm -f -t 0 $cname | ||
} | ||
|
||
@test "podman-system-service containers --host" { | ||
skip_if_remote "N/A under podman-remote" | ||
|
||
SERVICE_NAME=podman-service-$(random_string) | ||
port=$(random_free_port) | ||
URL=tcp://127.0.0.1:$port | ||
|
||
systemd-run --unit=$SERVICE_NAME $PODMAN system service $URL --time=0 | ||
wait_for_port 127.0.0.1 $port | ||
|
||
run_podman --host $URL run --rm $IMAGE true | ||
run_podman -H $URL run --rm $IMAGE true | ||
|
||
systemctl stop $SERVICE_NAME | ||
|
||
# Make sure the option is actually connecting | ||
run_podman 125 --host $URL run --rm $IMAGE true | ||
assert "$output" =~ "Cannot connect to Podman.*connection refused" | ||
Comment on lines
+413
to
+420
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we run containers? Could we just call info? That way we can also check for remote. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal here is to make sure the --host $URL is actually doing something including failing if the socket does not exist. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and info fails without socket. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And you think info would be faster? I just used what was suggested by Ed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say yes but it is not really important enough to argue over it. I am ok to merge this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just made my suggestion because I didn't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, the @test "podman-system-service containers --host" {
skip_if_remote "N/A under podman-remote"
SERVICE_NAME=podman-service-$(random_string)
# (Used only in teardown if the test fails)
touch $UNIT_FILE
port=$(random_free_port)
URL=tcp://127.0.0.1:$port
systemd-run --unit=$SERVICE_NAME $PODMAN system service $URL --time=0
wait_for_port 127.0.0.1 $port
for opt in --host -H; do
run_podman $opt $URL info --format '{{.Host.RemoteSocket.Path}}'
is "$output" "$URL" "RemoteSocket.Path using $opt"
done
systemctl stop $SERVICE_NAME
rm -f $UNIT_FILE
} This also adds an important cleanup step to prevent leaving the podman server behind on failure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And yes, I realize that the previous test (from which this was copied) also has a missing cleanup. That's now on my TODO list to fix. Unless you'd like to fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets get this merged and then fix the test, unless something else fails. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'll fix it in a cleanup PR later |
||
} | ||
# vim: filetype=sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of having an upper cased single character option when most (all?) of our others are lower case. But Docker compatibility, ugh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that -h had already been taken by --help.