Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Marcus Andersson
aurweb
Commits
d00f4c51
Commit
d00f4c51
authored
Sep 21, 2016
by
Lukas Fleischer
Browse files
Add tests for pkgmaint
Signed-off-by:
Lukas Fleischer
<
lfleischer@archlinux.org
>
parent
91f649f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/setup.sh
View file @
d00f4c51
...
...
@@ -13,6 +13,7 @@ GIT_SERVE="$TOPLEVEL/git-interface/git-serve.py"
GIT_UPDATE
=
"
$TOPLEVEL
/git-interface/git-update.py"
MKPKGLISTS
=
"
$TOPLEVEL
/scripts/mkpkglists.py"
TUVOTEREMINDER
=
"
$TOPLEVEL
/scripts/tuvotereminder.py"
PKGMAINT
=
"
$TOPLEVEL
/scripts/pkgmaint.py"
# Create the configuration file and a dummy notification script.
cat
>
config
<<-
EOF
...
...
test/t2300-pkgmaint.sh
0 → 100755
View file @
d00f4c51
#!/bin/sh
test_description
=
'pkgmaint tests'
.
./setup.sh
test_expect_success
'Test package base cleanup script.'
'
now=$(date -d now +%s) &&
threedaysago=$(date -d "3 days ago" +%s) &&
cat <<-EOD | sqlite3 aur.db &&
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS) VALUES (1, "foobar", 1, $now, 0);
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS) VALUES (2, "foobar2", 2, $threedaysago, 0);
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS) VALUES (3, "foobar3", NULL, $now, 0);
INSERT INTO PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS) VALUES (4, "foobar4", NULL, $threedaysago, 0);
EOD
"$PKGMAINT" &&
cat <<-EOD >expected &&
foobar
foobar2
foobar3
EOD
echo "SELECT Name FROM PackageBases;" | sqlite3 aur.db >actual &&
test_cmp actual expected
'
test_done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment