summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-09-15 17:46:37 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-09-15 18:57:03 +0100
commit1a89f13220d5832e7677362d7933f2fc96ab0f9d (patch)
tree95b915f2109834c4422d43aca924f3a3f7b31c3a /tests
parentfabf590901406b2a6cb3a9cd5f6906d3ff919067 (diff)
downloadlorry-1a89f13220d5832e7677362d7933f2fc96ab0f9d.tar.gz
tests: Verify that working repos for cvs and svn mirroring are bare
These will currently fail: * gitify_cvs creates non-bare repositories * gitify_svn creates non-bare repositories and changes them to bare, but leaves ref-logs enabled Related to #12.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cvs-single-commit.script12
-rw-r--r--tests/cvs-single-commit.stdout21
-rwxr-xr-xtests/svn-single-commit.script13
-rw-r--r--tests/svn-single-commit.stdout31
4 files changed, 75 insertions, 2 deletions
diff --git a/tests/cvs-single-commit.script b/tests/cvs-single-commit.script
index 728cc8b..a0639ba 100755
--- a/tests/cvs-single-commit.script
+++ b/tests/cvs-single-commit.script
@@ -2,7 +2,7 @@
#
# Tests converting a simple CVS repository to git.
#
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012, 2020 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,6 +23,14 @@ set -e
logfile="$DATADIR/cvs-test-repo.log"
workdir="$DATADIR/work-dir"
+normalize() {
+ sed -r -e '/hooks\/.*\.sample/d' \
+ -e "s/pack-[0-9a-z]+\.(idx|pack)$/pack-file/" \
+ -e "/\/objects\/info\/commit-graph$/d" \
+ -e "/\/objects\/pack\/pack-[0-9a-z]+\.bitmap$/d" \
+ -e "s|$DATADIR|DATADIR|g" "$@"
+}
+
# CVS wants $USER, $LOGNAME, and $LOGNAME set to a real username.
export USER=root
export LOGNAME=$USER
@@ -44,3 +52,5 @@ export USERNAME=$USER
echo "commit messages:"
git log --pretty='%s' master
)
+
+find "$workdir/cvs-test-repo" | LC_ALL=C sort | normalize
diff --git a/tests/cvs-single-commit.stdout b/tests/cvs-single-commit.stdout
index 91f58b0..6938eda 100644
--- a/tests/cvs-single-commit.stdout
+++ b/tests/cvs-single-commit.stdout
@@ -6,3 +6,24 @@ first line
commit messages:
first commit
initial checkin
+DATADIR/work-dir/cvs-test-repo
+DATADIR/work-dir/cvs-test-repo/git-a
+DATADIR/work-dir/cvs-test-repo/git-a/HEAD
+DATADIR/work-dir/cvs-test-repo/git-a/branches
+DATADIR/work-dir/cvs-test-repo/git-a/config
+DATADIR/work-dir/cvs-test-repo/git-a/description
+DATADIR/work-dir/cvs-test-repo/git-a/hooks
+DATADIR/work-dir/cvs-test-repo/git-a/info
+DATADIR/work-dir/cvs-test-repo/git-a/info/exclude
+DATADIR/work-dir/cvs-test-repo/git-a/info/refs
+DATADIR/work-dir/cvs-test-repo/git-a/lorry-update-count
+DATADIR/work-dir/cvs-test-repo/git-a/objects
+DATADIR/work-dir/cvs-test-repo/git-a/objects/info
+DATADIR/work-dir/cvs-test-repo/git-a/objects/info/packs
+DATADIR/work-dir/cvs-test-repo/git-a/objects/pack
+DATADIR/work-dir/cvs-test-repo/git-a/objects/pack/pack-file
+DATADIR/work-dir/cvs-test-repo/git-a/objects/pack/pack-file
+DATADIR/work-dir/cvs-test-repo/git-a/packed-refs
+DATADIR/work-dir/cvs-test-repo/git-a/refs
+DATADIR/work-dir/cvs-test-repo/git-a/refs/heads
+DATADIR/work-dir/cvs-test-repo/git-a/refs/tags
diff --git a/tests/svn-single-commit.script b/tests/svn-single-commit.script
index 533f1dc..7ae2eb9 100755
--- a/tests/svn-single-commit.script
+++ b/tests/svn-single-commit.script
@@ -2,7 +2,7 @@
#
# Tests converting a simple SVN repository to git.
#
-# Copyright (C) 2012 Codethink Limited
+# Copyright (C) 2012, 2020 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,6 +23,15 @@ set -e
logfile="$DATADIR/svn-test-repo.log"
workdir="$DATADIR/work-dir"
+normalize() {
+ sed -r -e '/hooks\/.*\.sample/d' \
+ -e "s/pack-[0-9a-z]+\.(idx|pack)$/pack-file/" \
+ -e "/\/objects\/info\/commit-graph$/d" \
+ -e "/\/objects\/pack\/pack-[0-9a-z]+\.bitmap$/d" \
+ -e "s/\b[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\b/UUID/" \
+ -e "s|$DATADIR|DATADIR|g" "$@"
+}
+
"${SRCDIR}/test-lorry" --pull-only --log="$logfile" --working-area="$workdir" \
"$DATADIR/svn-test-repo.lorry" > /dev/null 2> /dev/null
@@ -39,3 +48,5 @@ workdir="$DATADIR/work-dir"
# list the commit messages
git log --pretty='%s' master
)
+
+find "$workdir/svn-test-repo" | LC_ALL=C sort | normalize
diff --git a/tests/svn-single-commit.stdout b/tests/svn-single-commit.stdout
index eae50d1..8cb2926 100644
--- a/tests/svn-single-commit.stdout
+++ b/tests/svn-single-commit.stdout
@@ -1,3 +1,34 @@
refs/heads/master
first line
first commit
+DATADIR/work-dir/svn-test-repo
+DATADIR/work-dir/svn-test-repo/git-a
+DATADIR/work-dir/svn-test-repo/git-a/HEAD
+DATADIR/work-dir/svn-test-repo/git-a/branches
+DATADIR/work-dir/svn-test-repo/git-a/config
+DATADIR/work-dir/svn-test-repo/git-a/description
+DATADIR/work-dir/svn-test-repo/git-a/hooks
+DATADIR/work-dir/svn-test-repo/git-a/info
+DATADIR/work-dir/svn-test-repo/git-a/info/exclude
+DATADIR/work-dir/svn-test-repo/git-a/info/refs
+DATADIR/work-dir/svn-test-repo/git-a/lorry-update-count
+DATADIR/work-dir/svn-test-repo/git-a/objects
+DATADIR/work-dir/svn-test-repo/git-a/objects/info
+DATADIR/work-dir/svn-test-repo/git-a/objects/info/packs
+DATADIR/work-dir/svn-test-repo/git-a/objects/pack
+DATADIR/work-dir/svn-test-repo/git-a/objects/pack/pack-file
+DATADIR/work-dir/svn-test-repo/git-a/objects/pack/pack-file
+DATADIR/work-dir/svn-test-repo/git-a/packed-refs
+DATADIR/work-dir/svn-test-repo/git-a/refs
+DATADIR/work-dir/svn-test-repo/git-a/refs/heads
+DATADIR/work-dir/svn-test-repo/git-a/refs/tags
+DATADIR/work-dir/svn-test-repo/git-a/svn
+DATADIR/work-dir/svn-test-repo/git-a/svn/.metadata
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/.rev_map.UUID
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/index
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/unhandled.log
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/remotes
+DATADIR/work-dir/svn-test-repo/git-a/svn/refs/remotes/git-svn