Commit Graph

29 Commits

Author SHA1 Message Date
Yuya Nishihara
29fb442439 ssl: set explicit symbol "!" to web.cacerts to disable SSL verification (BC)
The next patch will enable verification by using the system's CA store if
possible, which means we would have to distinguish None (=use default) from
'' (=--insecure). This smells bug-prone and provides no way to override
web.cacerts to forcibly use the system's store by --config argument.

This patch changes the meaning of web.cacerts as follows:

  value   behavior
  ------- ---------------------------------------
  None/'' use default
  '!'     never use CA certs (set by --insecure)
  <path>  verify by the specified CA certificates

Values other than <path> are for internal use and therefore undocumented.
2015-03-04 23:27:04 +09:00
Yuya Nishihara
6b95472c9c test-https: enable dummycert test only if Apple python is used (issue4500)
The dummycert trick works only if Python is linked to Apple's patched OpenSSL.
2015-03-04 22:41:48 +09:00
Augie Fackler
39d629927d hghave: we now support Python 2.7.9's ssl for https 2015-01-13 15:08:55 -05:00
Augie Fackler
c2e4fc2371 hghave: use a less brittle have-json check 2014-11-10 13:27:25 -05:00
Yuya Nishihara
0baf7a676d cmdserver: add service that listens on unix domain socket and forks process
Typical use case of 'unix' mode is a background hg daemon.

    $ hg serve --cmdserver unix --cwd / -a /tmp/hg-`id -u`.sock

Unlike 'pipe' mode in which parent process keeps stdio channel, 'unix' server
can be detached.  So clients can freely connect and disconnect from server,
saving Python start-up time.

It might be better to write "--cmdserver socket -a unix:/sockpath" instead
of "--cmdserver unix -a /sockpath" in case hgweb gets the ability to listen
on unix domain socket.
2014-10-04 16:46:50 +09:00
Pierre-Yves David
65dc6712bd test: protect the run-tests.py --json test behind an hghave rule
We add a rules to detect availability of a json module and skip if json is not
available.
2014-09-18 11:43:47 -07:00
Mads Kiilerich
69f5c2ecc6 ssl: on OS X, use a dummy cert to trick Python/OpenSSL to use system CA certs
This will give PKI-secure behaviour out of the box, without any configuration.

Setting web.cacerts to any value or empty will disable this trick.

This dummy cert trick only works on OS X 10.6+, but 10.5 had Python 2.5 which
didn't have certificate validation at all.
2014-09-26 02:19:48 +02:00
Mads Kiilerich
5d1360e0ed cleanup: make sure we always access members of imported modules
This will make sure we get import errors, even if demandimport is enabled.

This will also mute some pyflakes 'imported but unused' warnings.
2014-08-15 04:37:45 +02:00
Matt Mackall
74cb506481 tests: use a decorator for hghave checks 2014-08-11 09:35:24 -05:00
Matt Mackall
36234f5a00 tests: add repository check for pyflakes test
If this test was run from a tarball with no Mercurial repository, it
would fail because 'hg manifest' didn't work.
2014-05-01 09:42:23 -05:00
Matt Mackall
eb09e501b5 tests: fix unused imports from inotify removal caught by pyflakes 2014-03-04 09:56:59 -06:00
Matt Mackall
66c8bd54e8 extensions: remove the inotify extension (BC)
This extension has always had correctness issues and has been
unmaintained for years. It is now removed in favor of the third-party
hgwatchman which is maintained and appears to be correct.

Users with inotify enabled in their config files will fall back to
standard status performance.
2014-03-01 16:20:15 -06:00
Mads Kiilerich
59b97fe104 tests: ignore http tests that are known wontfix failures on python 2.4
As mentioned on http://bz.selenic.com/show_bug.cgi?id=2739#c17 , babf177f9036
left test-http.t failing on Python < 2.4.3. That has not been noticed because
most 2.4 testing has been done with a patched 2.4.2.

This makes sure that the tests only are run for Python >= 2.4.3. That makes it
possible to verify that everything else works with Python 2.4.
2014-02-05 01:37:37 +01:00
Mads Kiilerich
5be7383671 tests: 'hghave tic' also requires curses support in Python
test-status-color.t would fail when using a Python without curses.
2014-01-20 01:29:54 +01:00
Simon Heimberg
2f030231df tests: fix hghave root on windows
This lets tests\test-hghave.t pass on windows where geteuid does not exist.
2013-11-23 01:06:20 +01:00
Matt Mackall
280eec0087 tests: skip tests that require not having root (issue4089)
This adds a new root hghave to test against. Almost all of these are a
subset of unix-permissions, but that is also used for checking exec
bit handling.
2013-11-14 18:07:43 -06:00
FUJIWARA Katsunori
aa64a2119a hghave: add "py3k" feature to check whether test runs with Python 3.x
This patch adds "py3k" feature to check whether test runs with Python
3.x.

This check is needed for portability of test code: for example, in the
default, modules are imported relatively first with python 2.x, but
imported absolutely with Python 3.x.
2013-10-05 01:02:22 +09:00
FUJIWARA Katsunori
c46519c9ab hghave: add "absimport" feature to check "absolute_import" in __future__
This patch adds "absimport" feature to check whether "absolute_import"
exists in __future__, which means supporting module loading by
absolute name.

This check is needed for portability of test code using
"absolute_import", because Python earlier than 2.5 doesn't support it.
2013-10-05 01:02:22 +09:00
Simon Heimberg
6059e06d0f cleanup: drop unused variables and an unused import 2013-07-01 20:48:56 +02:00
Jim Hague
3d040369cd tests: AIX can't handle negative date in test-dirstate.t
test-dirstate.t fails on AIX in the absurd date test. AIX touch errors on
any date prior to 1970. AIX mktime() gives an error on such dates, so the
problem is deeper than touch and attempts to work around touch in Python
failed.

Give up. Add an AIX test to hghave and skip the absurd date test on AIX.
2013-04-30 14:56:33 +01:00
Bryan O'Sullivan
8b517d42bc hghave: introduce a test (unused) for cvs >= 1.12 2013-01-09 13:16:54 -08:00
Thomas Arendsen Hein
024d25472d subrepo, hghave: use "svn --version --quiet" to determine version number
svn --version --quiet is implemented since svn 0.14.1 (August 2002)
and prints just the version number, not the long output (21 lines)
of "svn --version".

Additionally I expect this output format to be more stable, at least
it is not changed with different translations.
2012-10-04 16:52:20 +02:00
Patrick Mezard
622b756249 test-http-branchmap: enable on Windows
Tests using "hg serve --daemon" are currently disabled on Windows for
lack of proper kill utility. The one shipped with MinGW operates on
internal process identifiers and not on the ones recorded by hg serve.
Fortunately we can replace most of them by calls to killdaemons.py.

This patch is a proof of concept on how to run these tests on Windows.
The plan is:
- Check test-http-branchmap.t does not fail/hang on the buildbot
- Convert all kill utility calls to killdaemons.py calls.
- Add a rule in check-code.py to forbid kill calls, or ignore the
  remaining ones (test-hup.t, etc.).
- Possibly drop the 'serve' rule from hghave.

The:

  listening at http://*:$HGPORT1/

line does not appear on Windows because the detached process can no
longer write on its parent streams. Grepping hg serve stdout directly
causes the parent process to never return and hangs the test. This is a
bug, but I have no simple solution and prefer to pay this small price
and enable hg serve tests on Windows.
2012-09-09 12:31:14 +02:00
Mads Kiilerich
490f13d607 tests: hghave outer-repo should be true even if a bad repo is found
Only the abort message 'no repository found' is a reliable indication that
there is no outer repo.
2012-06-20 23:41:21 +02:00
Mads Kiilerich
bf6fb79f83 tests: introduce hghave hardlinks
Some tests can't be run on FAT filesystems because it doesn't support
hardlinks.
2012-06-15 00:02:27 +02:00
Mads Kiilerich
c909f8280c tests/hghave: test that the inotify unix socket actually can be created
Inotify do not work on FAT filesystems.
2012-06-15 00:02:27 +02:00
Mads Kiilerich
395b2875e3 tests/hghave: test that a fifo actually can be created on the filesystem
Some tests were failing on FAT filesystems.
2012-06-15 00:02:27 +02:00
Mads Kiilerich
266857283d tests/hghave: consistently use dir='.', prefix=tempprefix for tempfiles
Some feature tests were done in the wrong directory and could thus give the
wrong result.
2012-06-15 00:02:27 +02:00
Adrian Buehlmann
c74860921b tests/hghave: extract hghave.py
hghave is degraded to a bare script, moving the functions to hghave.py
so they can be shared later on.
2012-06-14 12:54:54 +02:00