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_system.vim not passing with X11 forwarding and PuTTY #1812

Closed
Xiretza opened this issue Jul 2, 2017 · 4 comments
Closed

test_system.vim not passing with X11 forwarding and PuTTY #1812

Xiretza opened this issue Jul 2, 2017 · 4 comments

Comments

@Xiretza
Copy link

Xiretza commented Jul 2, 2017

Note: this whole scenario requires vim to be configured with --with-x=yes.

When using X11Forwarding, authentication happens using the ~/.Xauthority file. In setup.vim, $HOME gets set to a non-existent path, thus breaking authentication. This, in turn, produces an error message when executing vim with some SSH clients (notably PuTTY and its derivative MobaXterm) along the lines of MobaXterm X11 proxy: Unsupported authorisation protocol on stderr.

This error message gets prepended to the desired $? in test_system.vim#L56, so a[0] contains 'M', not '0'. This leads to the actual error message that gets produced when running make test:

From test_system.vim:
Found errors in Test_system_exmode():
function RunTheTest[24]..Test_system_exmode line 7: Expected '0' but got 'M'

Since this isn't an error in how vim was compiled, but rather a result $HOME being unset, it shouldn't break testing.

It can be temporarily fixed by changing the value in setup.vim to something like /tmp/vimhome, creating that directory, and copying the ~/.Xauthority file in there. A better solution would probably be to either set $HOME temporarily, or to have the test simply ignore stderr, for example by changing test_system.vim#L52:

let cmd = ' -es -u NONE -c "source Xscript" +q 2>/dev/null; echo $?'

I've tracked the message down to this line in the PuTTY sources, after which it seems to be passed back to the remote host.

For completeness, here's the steps to reproduce the test failure:

  1. Connect to a machine using PuTTY/MobaXterm with X11 forwarding enabled on both sides
  2. Run make test on a vim instance that's compiled with +X11
  3. Test_system_exmode() fails
@brammool
Copy link
Contributor

brammool commented Jul 2, 2017 via email

@Xiretza
Copy link
Author

Xiretza commented Jul 3, 2017

We could change "echo $?" into something like "echo "result = $?"", and then search the output for "result = {nr}".

That would of course work. An even better solution might be to set $XAUTHORITY though, according to man xauth it can be used to point to the .Xauthority file directly. This would avoid the error altogether.

@brammool
Copy link
Contributor

brammool commented Jul 3, 2017 via email

@Xiretza
Copy link
Author

Xiretza commented Jul 5, 2017

Sorry for the wait. That solution works great, thanks!

dpelle pushed a commit to dpelle/vim that referenced this issue Jul 31, 2017
Problem:    System test failing when using X11 forwarding.
Solution:   Set $XAUTHORITY before changing $HOME. (closes vim#1812)
            Also use a better check for the exit value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants