Skip to content
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

Test LibGit2 SSH authentication #17651

Merged
merged 1 commit into from
Aug 7, 2016
Merged

Test LibGit2 SSH authentication #17651

merged 1 commit into from
Aug 7, 2016

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 27, 2016

This was part of #17586 (and those commits will show up here until that is merged) and is a WIP attempt at writing a test for all the authentication stuff. Currently flakey, so do not merge until I've had a chance to fix that.

@tkelman tkelman added test This change adds or pertains to unit tests libgit2 The libgit2 library or the LibGit2 stdlib module labels Jul 27, 2016
@tkelman
Copy link
Contributor

tkelman commented Jul 27, 2016

thanks. all of the now-collapsed review from #17586 on the test/ content still applies here

@Keno
Copy link
Member Author

Keno commented Jul 27, 2016

Yep

@Keno
Copy link
Member Author

Keno commented Aug 2, 2016

Rebased, still don't merge though. Now triggers a kernel hang when you attach a debugger. Will try with a more recent kernel to see what I can do.

@Keno Keno force-pushed the kf/libgit2test branch 2 times, most recently from b0ad410 to 423bc9d Compare August 5, 2016 23:39
@Keno Keno changed the title WIP: test LibGit2 SSH authentication Test LibGit2 SSH authentication Aug 5, 2016
@Keno
Copy link
Member Author

Keno commented Aug 5, 2016

Ok, this should be good to go if and when CI passes.

ssh_repo = joinpath(dir, "Example.SSH")
if !is_windows()
try
sshd_command = strip(readstring(`which sshd`))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is not always installed. how about success(sshd) inside a try catch?

#17586 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the purpose of this command. sshd refuses to be invoked as anything other than it's absolute path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh. add a comment that says that.

@Keno
Copy link
Member Author

Keno commented Aug 6, 2016

Review comments addressed and hopefully added support for the ancient versions of openssh we apparently have on CI.

@tkelman
Copy link
Contributor

tkelman commented Aug 6, 2016

hopefully added support for the ancient versions of openssh

What was the change for that?

@Keno
Copy link
Member Author

Keno commented Aug 6, 2016

Use -e and an explicitly opened file for STDERR rather than -E.

@tkelman
Copy link
Contributor

tkelman commented Aug 6, 2016

Should "libgit2" be added to net_required_for here

net_required_for = ["socket", "parallel"]
? It looks like it shouldn't require outside internet access like pkg or libgit2-online, but it does need a localhost socket?

@Keno
Copy link
Member Author

Keno commented Aug 6, 2016

Hmm, yeah I suppose it does require a loopback.

@@ -80,7 +80,7 @@ function choosetests(choices = [])
prepend!(tests, linalgtests)
end

net_required_for = ["socket", "parallel"]
net_required_for = ["socket", "parallel", "libgit2"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not libgit2 but libgit2-online

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these tests are in libgit2, since they don't require a network connection but they do require lo. I suppose we could split them out yet again, but not sure it's worth it. @tkelman?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fine, I rarely see net_on not true. WSL is one of the few places that's the case

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

World Surf League?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows subsystem for linux - aka bash on ubuntu on windows

@wildart
Copy link
Member

wildart commented Aug 6, 2016

I thought that you always have a loopback on any modern OS.

@tkelman tkelman merged commit 7f074e9 into master Aug 7, 2016
@tkelman tkelman deleted the kf/libgit2test branch August 7, 2016 06:45
ranjanan pushed a commit to ranjanan/julia that referenced this pull request Aug 8, 2016
@Keno
Copy link
Member Author

Keno commented Aug 8, 2016

Could potentially be fixed by #17874.

@tkelman
Copy link
Contributor

tkelman commented Aug 10, 2016

not fixed by #17874, will prevent new nightlies from being built until working properly https://build.julialang.org/builders/build_centos7.1-x64/builds/1703/steps/shell_2/logs/stdio

@wildart
Copy link
Member

wildart commented Aug 10, 2016

It's not related to #17874. There is something wrong with SSHD key setup.

    From worker 7:    Expression: isfile(joinpath(ssh_repo,"testfile"))
    From worker 7:  SSHD logfile contents follows:
    From worker 7:  Could not load host key: /tmp/tmpZ3Yh3P/ssh_host_rsa_key
    From worker 7:  Could not load host key: /tmp/tmpZ3Yh3P/ssh_host_dsa_key
    From worker 7:  HOME: /tmp/tmpZ3Yh3P
    From worker 7:  GitError(Code:ERROR, Class:OS, Failed to connect to localhost: Connection refused)

@Keno
Copy link
Member Author

Keno commented Aug 10, 2016

@tkelman can you see if ssh-keygen is working on the buildbots, perhaps we should include ssh-keygen output in the log file?

@wildart
Copy link
Member

wildart commented Aug 10, 2016

Better put a -d option to sshd call for debug output.

@Keno
Copy link
Member Author

Keno commented Aug 10, 2016

-d only allows one connection. See the debug flag that's already in the test

@tkelman
Copy link
Contributor

tkelman commented Aug 11, 2016

What should I look for?

@Keno
Copy link
Member Author

Keno commented Aug 11, 2016

Try the keygen commands in the test file. If that works fine, enable the debug flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants