1
0
Fork 0
mirror of synced 2024-11-18 23:25:35 -05:00
Commit graph

201 commits

Author SHA1 Message Date
Tim Byrne
32baf81b56
Support specifying a command after yadm enter 2019-12-08 15:17:47 -06:00
Tim Byrne
397d45ccd0
Suppress insecure memory warnings 2019-12-05 15:02:47 -06:00
Tim Byrne
437ae2b719
Add --force-linters option to pylint (#179)
When this option is provided, linters will be run regardless of the
version installed. Normally tests are skipped if the linters are not the
supported version.
2019-12-05 15:02:47 -06:00
Tim Byrne
5d484ca825
Test with GnuPG 2 (#179)
Take advantage of pinentry-mock to obtain passphrases, instead of using
"expect" (which requires GnuPG 1).
2019-12-05 15:02:47 -06:00
Tim Byrne
e5ff95d09c
Create gnupg fixture
This fixture is a session scoped gnupg home directory, along with a
method to set the mocked password which will be used by the
pinentry-mock program.
2019-12-05 15:02:46 -06:00
Tim Byrne
3aefeeff0f
Create pinentry-mock
This is a program which adheres to the pinentry protocol. It always
provides the password located in /etc/mock-password.
2019-12-05 15:02:43 -06:00
Tim Byrne
f7485915ed
Update tests for gawk support 2019-12-04 22:18:55 -06:00
Tim Byrne
c1f779521c
Confirm LEGACY_WARNING_ISSUED is set appropriately 2019-12-04 17:36:43 -06:00
Tim Byrne
66a3969c8a
Add unit tests for reporting invalid alternates (#183) 2019-12-04 17:36:43 -06:00
Tim Byrne
59da359e63
Remove old-style alts from test data 2019-12-04 08:17:03 -06:00
Tim Byrne
6bf0852609
Use /etc/os-release if lsb_release is missing (#175) 2019-11-30 18:31:27 -06:00
Tim Byrne
24e6e81713
Test support for double-star globs 2019-11-26 16:24:36 -06:00
Tim Byrne
5634c09a8a
Refactor symlink code
Update variable names, favoring the terminology used by `ln`.
* source (original file containing data)
* target (the symlink file, pointing to source)
2019-11-25 08:24:46 -06:00
Tim Byrne
98392b9a9c
Add function relative_path
This function will create a path relative to another, without the use of
an external program like dirname.
2019-11-24 13:15:42 -06:00
Tim Byrne
f8d6d2b0e4
Change tests to expect relative links 2019-11-24 13:15:42 -06:00
Tim Byrne
c29834ed86
Add test for permission bug (#174) 2019-11-12 06:52:49 -06:00
Tim Byrne
375a34b97a
Test conditional submodule upgrade processing 2019-11-07 07:48:42 -06:00
Tim Byrne
f2b2d505a2
Reinitialize submodules during upgrade 2019-11-05 16:36:05 -06:00
Tim Byrne
616baaeac6
Rename default template processor 2019-10-30 17:29:17 -05:00
Tim Byrne
b62a4c77a6
Create an upgrade command
This command will assist users with migration from 1.x.x to 2.0.0.
2019-10-23 17:08:04 -05:00
Tim Byrne
0c9468c9b5
Ignore encrypted files (#69)
Append the contents of .config/yadm/encrypt to the repo's git ignore
list. This is to help prevent accidentally committing unencrypted
sensitive data.
2019-10-17 08:22:17 -05:00
Tim Byrne
f3249e00b5
Ensure base directories for alternates before creation 2019-10-12 18:22:02 -05:00
Tim Byrne
6d5467951a
Properly handle missing "." in alternate conditions 2019-10-12 09:59:03 -05:00
Tim Byrne
4ea3ed9e2a
Allow storing alternates elsewhere (#90)
This change allows alternates to be stored in "$YADM_DIR/alt". The
correct path within the work tree will be symlinked.

Storing alternates within the work tree is still allowed. Both locations
will be considered when choosing an appropriate alternate file.
2019-10-12 09:59:02 -05:00
Tim Byrne
aeb6a54ad7
Add source to templates (#163)
A new variable is exposed to templates, which holds the filename of the
template source. The primary use case is to be able to include a warning
message within the template. For example:

  # Do not edit. This file auto-generated from {{ yadm.source }}.
2019-10-11 07:23:52 -05:00
Tim Byrne
0c7aec6dd7
Clarify xfails are for deprecated features 2019-10-11 07:22:38 -05:00
Tim Byrne
3a192db420
Remove symlinks before processing a template 2019-10-11 07:20:03 -05:00
Tim Byrne
574945f010
Change yadm.cygwin-copy to yadm.alt-copy
This removes the constraint of only allowing the copy option on Cygwin
systems. Now any system can configure this option.
2019-10-09 18:47:42 -05:00
Tim Byrne
e51166b7e8
Improve clone testing 2019-10-08 17:28:56 -05:00
Tim Byrne
f3bde37f78
Support -b <branch> when cloning (#133) 2019-10-08 17:28:53 -05:00
Tim Byrne
6a3199ceea
Support DISTRO in alternates (#72) 2019-10-06 16:35:47 -05:00
Tim Byrne
444622a658
Support else statements in builtin templates 2019-10-05 11:43:48 -05:00
Tim Byrne
e999929818
Change builtin templates to resemble jinja 2019-10-02 15:16:41 -05:00
Tim Byrne
b411f9d74f
Split out processing of stale links 2019-10-02 15:16:10 -05:00
Tim Byrne
c8a9165293
Remove warnings from tests
These warnings are related to bugs which are fully fixed.
2019-10-02 15:16:10 -05:00
Tim Byrne
36212cb752
Add new alternates processing the cygwin copy testing 2019-10-02 15:16:09 -05:00
Tim Byrne
eeba216cfe
Mark deprecated tests 2019-10-02 15:16:09 -05:00
Tim Byrne
d2afab6846
Fix newly discovered linting errors 2019-10-02 15:16:09 -05:00
Tim Byrne
2508378617
Upgrade yadm testbed
* Update software in Dockerfile
* Add j2cli
* Bump supported versions of linters
2019-10-02 15:16:09 -05:00
Tim Byrne
cfda485b34
Implement future alternate processing 2019-10-02 15:16:02 -05:00
Tim Byrne
e4e956fe21
Split discovery of alternates test data into a testable function 2019-09-27 08:40:32 -05:00
Tim Byrne
c29292d02b
Split out processing of alt (past/future) 2019-09-27 08:40:31 -05:00
Tim Byrne
48fc6b0db7
Support XDG base directory specification
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2019-09-27 08:40:31 -05:00
Tim Byrne
d87a6502af
Factor out some branches in utils:create_alt_files() 2019-04-12 07:54:23 -05:00
Tim Byrne
7bc8f02d68
Add tests for jinja includes 2019-04-12 07:54:23 -05:00
Tim Byrne
093fc24b1b
Test that links are removed for invalid alternates (#65) 2019-04-05 08:58:59 -05:00
Tim Byrne
2375a0955b
Standardize sort order
Prevent localizations from interfering with sorting order.
2019-04-05 08:58:30 -05:00
Tim Byrne
fb1181c8a9
Add tests for directory alternates
While this feature was added back in version 1.05, tests were never
added for it. These tests have identified bugs in the directory
alternates.
2019-04-05 08:58:22 -05:00
Tim Byrne
58edf313aa
Process .yadm/encrypt in sorted order 2019-03-24 17:05:11 -05:00
Tim Byrne
826f9bc09e
Validate yaml files with yamllint 2019-03-21 23:05:57 -05:00
Tim Byrne
c3a9b62189
Remove BATS-based tests 2019-02-25 17:08:07 -06:00
Tim Byrne
e7f9616b39
Rewrite testing system (#119)
The new test system is written with py.test. These tests are more
comprehensive, run faster by an order of magnitude, and are far more
maintainable. The tests themselves conform to PEP8.
2019-02-20 07:48:25 -06:00
Tim Byrne
2517e4b4ac
Add test-case for exclusions in .yadm/encrypt (#86) 2017-09-21 14:21:22 -05:00
Tim Byrne
cc30dfc24b
Re-number unit tests 2017-09-16 09:33:12 -05:00
Tim Byrne
f23bdb8147
Remove last use of LS_PROGRAM
Globs are not determined by an `eval` of `ls` anymore. The only other
use of `ls` can be replaced with a simple `printf`.
2017-09-16 09:33:12 -05:00
Tim Byrne
b78bb1eef4
Eliminate the use of eval
`eval` has always been used to process the globs in `.yadm/encrypt`.
This is being removed, as there is a risk of executing "dirty" data
found in `.yadm/encrypt`.

Caveats of this change:
  * Brace and tilde expansion will no longer work in `.yadm/encrypt`
  * Paths with spaces must not be quoted anymore
2017-09-16 09:32:38 -05:00
Tim Byrne
df952094a1
Add test case for supporting directories in .yadm/encrypt (#81) 2017-09-04 13:19:04 -05:00
Tim Byrne
ebc90bfc98
Create secured private dirs (#74)
Directories are created prior to merge during clone, and prior to any
Git command run.

This directly addresses CVE-2017-11353.

When cloning a repo which includes data in a .ssh or .gnupg directory,
if those directories do not exist at the time of cloning, yadm will
create the directories with mask 0700 prior to merging the fetched data
into the work-tree.

When running a Git command and .ssh or .gnupg directories do not exist,
create those directories with mask 0700 prior to running the Git
command. However, do not create those directories if
yadm.auto-private-dirs is false.
2017-08-22 21:28:07 -05:00
Tim Byrne
557ce93fab
Add tests for hooks 2017-07-05 16:33:50 -05:00
Tim Byrne
5293db986a
Support YADM_DISTRO in Jinja templates (#68) 2017-07-03 16:21:27 -05:00
Tim Byrne
7538851fe3
Gracefully handle changes in yadm.cygwin-copy 2017-06-01 17:06:27 -05:00
Tim Byrne
f8e0bd593d
Support yadm.cygwin-copy configuration (#62)
With `yadm.cygwin-copy` set to "true", alternate files will be copies
instead of symlinks, but only when running on Cygwin.
2017-05-31 18:28:54 -05:00
Tim Byrne
79e149ed25
Switch to semantic versioning 2017-05-10 08:00:29 -05:00
Tim Byrne
356c47a19f
Add Bash completion script (#60)
* Add completion script
* Add introspection
2017-04-24 07:49:10 -05:00
Tim Byrne
eabf9091fb
Support WSL detection (#61)
`uname -s` was already being executed every run for *cygwin* detection.
I've consolidated all of the OS detection into a single function. This
also fixed the problem of running `uname -s` twice for the `alt`
command.
2017-04-09 08:47:18 -05:00
Tim Byrne
9824de5410
Change template indicator to ##yadm.j2 2017-03-31 16:42:51 -05:00
Tim Byrne
fda2da6a5b
Fix tests that set local.hostname (#59) 2017-03-31 12:43:32 -05:00
Tim Byrne
3a87fe311a
Add test case for envtpl missing 2017-03-31 00:04:28 -05:00
Tim Byrne
aaa4152fac
Remove trailing whitespace 2017-03-30 21:58:26 -05:00
Tim Byrne
fd6fa8c923
Merge pull request #58 from janschulz/jinja_processing
Excluding yadm.md changes (these will happen during a release)
2017-03-30 17:00:27 -05:00
Tim Byrne
6974e4ce8c
Add tests for enter command 2017-03-30 16:30:39 -05:00
Jan Schulz
a479b70d8a Add jinja processing to alt command
With the new functionality, when the 'alt' command is called (or automatically
triggered), any file with a name ending in '##yadm_tmpl' is treated as a jinja
template. The template is processed by envtpl and the result is written to a
file without the '##yadm_tmpl' name. The variables passed into the template
processing are

  YADM_CLASS
  YADM_OS
  YADM_HOSTNAME
  YADM_USER

These variables are set according to the normal rules for
CLASS, OS, HOSTNAME, and USER during the alt processing.
2017-03-26 03:49:24 +02:00
Tim Byrne
297df5d231
Add tests for classes with a range of names (#51) 2017-03-25 11:32:06 -05:00
Tim Byrne
d80bbff2b9
Acceptance tests for encrypt globs and paths with space (#53, #54) 2017-03-24 17:37:40 -05:00
Tim Byrne
d28df86494
Store class/os/host/user overrides in the local repo config
Overrides are meant to be local to each system, unlike other
configurations which are often added to a user's dotfiles repository.

With this change, the configurations change names:

  alt.class => local.class
  alt.os    => local.os
  alt.host  => local.host
  alt.user  => local.user
2017-01-26 10:48:40 -06:00
Tim Byrne
76d90db627
Replace "TODO text" for yadm config (#46) 2017-01-25 17:31:56 -06:00
Tim Byrne
671b5c6ec6
Support both gpg1 and gpg2 missing key error messages 2017-01-25 09:13:59 -06:00
Tim Byrne
12a23178d8
Tests for offering bootstrap during clone (#45) 2017-01-25 08:31:40 -06:00
Tim Byrne
3f1a8364ae
Add tests for bootstrap command (#42) 2017-01-23 17:53:40 -06:00
Tim Byrne
02107c35d9
Add tests for stashed conflicting data during clone (#44) 2017-01-20 16:50:14 -06:00
Tim Byrne
d7abc7ff41
Create tests for class support in alt-links (#21) 2017-01-20 00:13:56 -06:00
Tim Byrne
1534420106
Acceptance tests for overriding OS/Host/User (#21) 2017-01-18 19:51:13 -06:00
Tim Byrne
3ea710317a
Add acceptance tests for alt-link wildcards (#43) 2017-01-18 01:46:51 -06:00
Tim Byrne
a25a180b88
Add acceptance tests for alt-link delimiters (#49)
Delimiters other than `.` should not be used.
This adds some test with delimiter `_`.
2017-01-16 17:51:48 -06:00
Tim Byrne
ef796bc2c1
Add acceptance test for space-lines/empty-lines in .yadm/encrypt (#40) 2017-01-08 11:05:33 -06:00
Tim Byrne
25d3123988
Unit tests for alternate Git program (#30) 2017-01-07 19:47:18 -06:00
Tim Byrne
0fd3e1559d
Rename unit tests for ls program 2017-01-07 19:47:07 -06:00
Tim Byrne
12a5179e8a
Add acceptance tests for alt-linking encrypted files (#34) 2017-01-07 16:04:55 -06:00
Tim Byrne
067a359e42
Add acceptance tests for improved exit values (#35) 2017-01-06 16:26:00 -06:00
Tim Byrne
5107198422
Add acceptance tests for white space alt paths (#36) 2017-01-06 07:50:36 -06:00
Tim Byrne
e40c054805
Use gpg1 (if available) for automated tests
gnupg2 does not support agent-less password input (breaking the
expect-driven tests).
2016-09-07 22:35:36 -05:00
Tim Byrne
60eb4c415f
Fallback to using ls if /bin/ls does not exist (#22) 2016-08-28 22:06:14 -05:00
Tim Byrne
e4d1b3a165
Unit tests for alternate gpg program (#19) 2016-08-14 23:53:21 -05:00
Tim Byrne
85abcf981c
Acceptance tests for symlinked directories (#17) 2016-08-14 23:52:54 -05:00
Tim Byrne
8bede1cb84 Test for correct error message when public key is missing 2016-04-21 09:10:47 -05:00
Tim Byrne
ea3b2ecfa8 Support yadm.gpg-recipient = ASK 2016-04-21 08:58:07 -05:00
Tim Byrne
7854275488 Create acceptance tests for asymmetric encryption 2016-04-21 07:13:40 -05:00
Tim Byrne
27d0e7baa2 Refactor path tests
Including new path tests for planned features
2016-04-08 17:31:00 -05:00
Tim Byrne
340f88bd52 Use -n instead of negating -z 2016-04-08 17:31:00 -05:00
Tim Byrne
f48dea6879 Resolve shellcheck errors in bats tests 2016-04-07 08:16:22 -05:00
Tim Byrne
d2cd3b1b26 Add tests
Tests will be run using `bats`.
2016-04-07 08:14:13 -05:00