Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-27 23:06:02 +0300
committerJunio C Hamano <gitster@pobox.com>2023-01-27 23:38:26 +0300
commiteeea9ae1657e32ee16f8452ff201b2ca54d51641 (patch)
tree4941c9077128276816a20786af941715eaf172f6 /t/t9210-scalar.sh
parent008217cb4a11b1bd9d25eda2d412d813cfeacd9f (diff)
t921*: test scalar behavior starting maintenance
A user recently reported issues with 'scalar register' and 'scalar clone' in that they failed when the system had permissions locked down so both 'crontab' and 'systemctl' commands failed when trying to enable background maintenance. This hard error is undesirable, but let's create tests that demonstrate this behavior before modiying the behavior. We can use GIT_TEST_MAINT_SCHEDULER to guarantee failure and check the exit code and error message. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9210-scalar.sh')
-rwxr-xr-xt/t9210-scalar.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index 25f500cf68..13a4f6dbcf 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -104,6 +104,13 @@ test_expect_success FSMONITOR_DAEMON 'scalar register starts fsmon daemon' '
test_cmp_config -C test/src true core.fsmonitor
'
+test_expect_success 'scalar register fails when background maintenance fails' '
+ git init register-repo &&
+ GIT_TEST_MAINT_SCHEDULER="crontab:false,launchctl:false,schtasks:false" \
+ test_must_fail scalar register register-repo 2>err &&
+ grep "could not turn on maintenance" err
+'
+
test_expect_success 'scalar unregister' '
git init vanish/src &&
scalar register vanish/src &&