Commit Graph

648 Commits

Author SHA1 Message Date
John Hood d15d342df3 Tests: symlink to tmux sockets
This makes it easier to attach a second client to inspect a test.
2017-05-28 19:27:39 -04:00
John Hood 2f89ac0ac7 Make tmux version check work with tmux master. 2017-05-28 13:19:12 -04:00
Giel van Schijndel cb91788d05 When binding on the IPv6 any address bind for IPv4 too
On some Linux systems this is the default. On most other operating
systems accepting IPv4 connections on a IPv6 socket only happens when
explicitly requested. Even on Linux it depends on the sysctl config.

This change makes it independent from the system's defaults whether IPv4
connections will be accepted too through the same socket.
2017-05-22 22:33:45 -04:00
John Hood 9f54cc76d2 Detect broken tmux in tests
This works around Debian kfreebsd build failures.
2017-05-21 12:49:18 -04:00
John Hood a6d580a7c5 Set locale more correctly in tests
This fixes Debian builds which only have LC_ALL=POSIX set.
2017-05-18 23:22:55 -04:00
John Hood 2fe33ff009 Disable unicode-later-combining.test for tmux 2.4. 2017-05-07 20:51:31 -04:00
John Hood 23ec4e59cb Revert "Disable unicode-later-combining.test for now"
This reverts commit df4dbe0d6c.
2017-05-07 20:28:14 -04:00
John Hood d205a98a87 Test for SCROLL UP and SCROLL DOWN. 2017-05-06 11:23:56 -04:00
John Hood 72199ffc0b Do not move cursor for SCROLL UP and SCROLL DOWN
This fixes #881, corrupted display of man pages with tables in tmux
2.4.
2017-05-06 11:15:43 -04:00
John Hood df4dbe0d6c Disable unicode-later-combining.test for now
tmux 2.4+ has serious bugs with combining characters.
2017-04-26 01:25:59 -04:00
John Hood 2873def506 Work around JuiceSSH rendering bug
JuiceSSH apparently has a bug where ECH for one character (ESC [ 1 X) does
not actually erase the character, in its code that receives and interprets
Mosh state updates.  This was hidden before because Mosh <= 1.2.5 never sent
this sequence, it sent ESC [ X instead as an optimization.

Do the better optimization of sending spaces for short sequences of blanks
instead.
2017-04-24 22:40:31 -04:00
Adrien Destugues aa74af9a34 Fix build on Haiku.
- Look for socket in libnetwork
- Look for forkpty in libbsd
2017-04-24 22:40:31 -04:00
John Hood 32b1e6ee4b Print {,/var}/run/motd.dynamic on Ubuntu. 2017-04-24 22:40:30 -04:00
John Hood 3f0ac51071 Don't print /etc/motd on IllumOS. 2017-04-24 22:40:30 -04:00
John Hood 95f7bf3e6c Let bools be bools. 2017-04-24 22:40:30 -04:00
John Hood 3b1984f9f8 Make tests work with OpenBSD's unversioned tmux
This tests for OpenBSD 6.x or later.  We could likely extend the
test to much older OpenBSD versions, but not without OS installs
and testing.
2017-04-24 22:40:30 -04:00
John Hood 654f269917 Make tests detect UTF-8 locale with a helper executable
This uses the same utility function that mosh-client/mosh-server do.
This resolves portability issues with the 'locale' command.
This fixes OpenBSD 6.0 and probably Haiku builds.
2017-04-24 22:38:47 -04:00
Jérémie Courrèges-Anglas c0bf8053b2 Remove deprecated pledge("ioctl")
Unbreaks mosh on recent (> 2017/03/18) OpenBSD systems.
2017-03-20 09:54:33 -04:00
John Hood 0fc950bd8a Ensure a UTF-8 locale is available for tests
Fixes Debian sid schroot build.

Also add build deps required for full testing:
tmux,  less (for window-resize.test)
2017-03-01 23:16:26 -05:00
John Hood 2e816205f7 window-resize.test: use a known-present file
/etc/services may not be present in a Debian sid schroot.
Also make $srcdir available to test scripts.
2017-03-01 23:16:26 -05:00
John Hood 1cad191b10 emulation-attributes.test: fix vt100 test failure
The failure only occurs in a Debian Sid schroot environment.
2017-03-01 23:16:26 -05:00
John Hood 936ee83d29 emulation-attributes.test: fix indentation 2017-03-01 23:16:26 -05:00
Keith Winstein da206f621c src/tests/.gitignore: add inpty 2017-02-06 23:32:32 -08:00
John Hood c1d85f04fc Eliminate dead code to placate GCC 7's -Wformat-truncation. 2017-01-31 23:08:03 -05:00
John Hood a993c83632 Handle GCC 7's new -Wimplicit-fallthrough. 2017-01-31 22:12:27 -05:00
Carlos Cabanero 0ceb4f26f4 Memory Alignment issues on ARM processors
Unaligned data on ARM architectures do not perform efficiently unaligned
memory access, and in the case of ARMv7 and iOS it completely breaks. The OCB
algorithm dereferences a uint64x2_t pointer, and is replaced by a
memcpy to avoid penalties when trying to align it.

More info https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebase/docs/kb95.html
2017-01-05 00:14:36 -05:00
John Hood ba5f33fd76 Do clock_gettime() weak symbol check only on OS X/iOS 2016-12-29 23:46:00 -05:00
John Hood b2eac32ebc Try multiple clock sources at runtime. 2016-12-29 15:10:06 -05:00
John Hood 278fd12ec1 More print-to-pipe error checking in tests. 2016-11-29 22:31:33 -05:00
John Hood 60c5b022f8 Check for assertion failures while testing. 2016-11-29 22:30:25 -05:00
John Hood bb54325dc9 s/geteuid/getuid/ for correct user lookups
Addresses an issue mentioned in #193.
2016-11-23 17:03:45 -05:00
John Hood 8fcfb3a587 Fix Coverity "missing move operator" (copy to rvalue).
Also makes this bit of code more readable, but the overall handling of
Unicode characters in Actions and Transitions is messy, and may get
reworked later.
2016-11-20 01:27:51 -05:00
John Hood 24eb5a7544 Remove a Network::Exception that isn't one.
Code smell pointed out by Coverity.
2016-11-19 21:11:04 -05:00
Anders Kaseorg 4fe706a4d3 src/test/local.test: Set TERM=xterm
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-19 18:31:29 -05:00
Anders Kaseorg f0f83f5c4e src/tests/inpty.cc: Send the inner stderr to the outer stderr
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-19 18:31:29 -05:00
Anders Kaseorg 94027efc45 Make all commands properly support --help and --version
These should output to stdout and exit with status 0.  Passing
std-options to AM_INIT_AUTOMAKE causes ‘make installcheck’ (hence also
‘make distcheck’) to verify this.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-19 17:15:48 -05:00
John Hood e8f1004f94 append_move(): improve awkward control flow, naming 2016-11-19 17:14:37 -05:00
John Hood 302c7deb41 Describe Cell width as a narrow/wide boolean.
A character cell can only be either narrow or wide.  It's more
convenient to represent that as an int containing 1 or 2, but slightly
more correct to represent it as a "boolean" single-bit integer.
2016-11-17 00:56:31 -05:00
John Hood 71fe4441ef Shrink Cell to its prior size by using bitfields. 2016-11-17 00:56:05 -05:00
John Hood e4aed30d30 Fix broken wrap behavior causing broken copy/paste.
The terminal framebuffer was not resetting the wrap state of a row
when a previously-wrapping line was overwritten by a non-wrapping
line.  Restore previous, subtle behavior of line wrap.  Fix wrap
verification bug now exposed by emulation-wrap-across-frames.test.

Also hoist some getters, mostly for clarity.

Fixes #820.
2016-11-17 00:50:46 -05:00
Anders Kaseorg f7f741dab4 src/tests/inpty.cc: Skip the test on forkpty failures
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-13 16:13:25 -05:00
john hood 74469a7592 inpty.cc: Align configuration to be like mosh-server.cc.
This fixes a FreeBSD 11.0 build failure.
2016-11-12 23:25:56 -05:00
Anders Kaseorg 43251ea8db Add a trivial test that the mosh script works without needing tmux
None of the previous tests even ran the mosh script unless tmux ≥ 1.8 is
installed.  Thus ‘make check’ was “passing” on, e.g., RHEL 6 even though
its Perl is too old (5.10.1).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-12 23:25:35 -05:00
John Hood c9d0c9c0c5 tests/prediction-unicode.test: env -u is not POSIX
Seen to fail on OpenBSD 5.2.
2016-11-12 15:33:07 -05:00
John Hood 52d10cf211 Add a test for spinning on no-change screen updates 2016-11-06 06:15:42 -05:00
John Hood dc292dcdaa Test for spinning Mosh 2016-11-06 06:15:42 -05:00
John Hood 9c55198635 Fix off-by-one error on timeouts for input history echo updates 2016-11-06 06:15:42 -05:00
John Hood 3e414c46b3 Update send/ack timers on empty diff
The root problem here is that writes to the frame buffer may alter it,
but leave it with the same contents as before, and the diff between
the two states is the empty string.  With the dirty-rows,
smart-pointer changes to Framebuffer, it is easy to run into this
situation.  This got Network::TransportSender confused about timeouts,
and mosh-server would spin.

The theoretically correct fix would be to have operator==() exactly
correspond to diff(otherstate).empty().  I have partly implemented
this (and may yet finish) but it's not trivial to get right.

This is a much simpler fix that simply attempts to correctly update
timers when two framebuffers are different and an empty diff is
generated.
2016-11-06 06:15:41 -05:00
John Hood 9ffbeddbc8 Put spin debug under -vv flag, and add to mosh-client 2016-11-06 06:15:41 -05:00
John Hood f89f1da0b5 Log/limit pselect() with timeout of 0
This is not a fix for bad timeouts, but rather a band-aid
to keep Mosh from consuming large amounts of CPU time.
2016-11-06 06:15:41 -05:00