|
| 1 | +# vi: set ft=conf |
| 2 | + |
| 3 | +[windows] dos2unix err1.txt err2.txt err3.txt errauth.txt |
| 4 | + |
| 5 | +# enable ssh lfs transfer |
| 6 | +env SOFT_SERVE_LFS_SSH_ENABLED=true |
| 7 | +# start soft serve |
| 8 | +exec soft serve & |
| 9 | +# wait for server to start |
| 10 | +waitforserver |
| 11 | + |
| 12 | +# create a user |
| 13 | +soft user create foo --key "$USER1_AUTHORIZED_KEY" |
| 14 | + |
| 15 | +# create a repo |
| 16 | +soft repo create repo1 |
| 17 | +soft repo create repo1p -p |
| 18 | +usoft repo create repo2 |
| 19 | +usoft repo create repo2p -p |
| 20 | + |
| 21 | +# SSH Git LFS Transfer command |
| 22 | +! soft git-lfs-transfer |
| 23 | +cmp stderr err1.txt |
| 24 | +! soft git-lfs-transfer repo1 |
| 25 | +cmp stderr err2.txt |
| 26 | +soft git-lfs-transfer repo1 download |
| 27 | +stdout '000eversion=1\n000clocking\n0000' |
| 28 | +soft git-lfs-transfer repo1 upload |
| 29 | +stdout '000eversion=1\n000clocking\n0000' |
| 30 | +usoft git-lfs-transfer repo1 download |
| 31 | +stdout '000eversion=1\n000clocking\n0000' |
| 32 | +! usoft git-lfs-transfer repo1 upload |
| 33 | +cmp stderr errauth.txt |
| 34 | + |
| 35 | +# Unauthorized user |
| 36 | +! usoft git-lfs-transfer |
| 37 | +cmp stderr err1.txt |
| 38 | +! usoft git-lfs-transfer repo1p |
| 39 | +cmp stderr err2.txt |
| 40 | +! usoft git-lfs-transfer repo1p download |
| 41 | +cmp stderr errauth.txt |
| 42 | +! usoft git-lfs-transfer repo1p upload |
| 43 | +cmp stderr errauth.txt |
| 44 | + |
| 45 | +# push & create repo with some files, commits, tags... |
| 46 | +mkdir ./repo1 |
| 47 | +git -c init.defaultBranch=master -C repo1 init |
| 48 | +mkfile ./repo1/README.md '# Project\nfoo' |
| 49 | +mkfile ./repo1/foo.png 'foo' |
| 50 | +mkfile ./repo1/bar.png 'bar' |
| 51 | +git -C repo1 remote add origin ssh://localhost:$SSH_PORT/repo1 |
| 52 | +git -C repo1 lfs install --local |
| 53 | +git -C repo1 lfs track '*.png' |
| 54 | +git -C repo1 add -A |
| 55 | +git -C repo1 commit -m 'first' |
| 56 | +git -C repo1 tag v0.1.0 |
| 57 | +git -C repo1 push origin HEAD |
| 58 | +git -C repo1 push origin HEAD --tags |
| 59 | + |
| 60 | +# clone repo with ssh lfs-transfer |
| 61 | +git clone ssh://localhost:$SSH_PORT/repo1 repo1c |
| 62 | +exists repo1c/README.md |
| 63 | +exists repo1c/foo.png |
| 64 | +exists repo1c/bar.png |
| 65 | + |
| 66 | +# stop the server |
| 67 | +[windows] stopserver |
| 68 | + |
| 69 | +-- err1.txt -- |
| 70 | +Error: accepts 2 arg(s), received 0 |
| 71 | +-- err2.txt -- |
| 72 | +Error: accepts 2 arg(s), received 1 |
| 73 | +-- err3.txt -- |
| 74 | +Error: invalid request |
| 75 | +-- errauth.txt -- |
| 76 | +Error: you are not authorized to do this |
0 commit comments