Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
2261582d
Commit
2261582d
authored
Jan 03, 2019
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell: Add (minimal) tests.
parent
a36ccf92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletion
+45
-1
shell/caucase.sh
shell/caucase.sh
+45
-1
No files found.
shell/caucase.sh
View file @
2261582d
...
...
@@ -1109,5 +1109,49 @@ EOF
fi
fi
}
_main
"
$@
"
_test
()
{
# shellcheck disable=SC2039
local
netloc
=
"
$1
"
\
tmp_dir
\
caucased_dir
\
caucased_pid
echo
'Automated testing...'
if
command
-v
caucased
>
/dev/null
;
then
:
else
echo
'caucased not found in PATH, cannot run tests'
>
&2
return
1
fi
tmp_dir
=
"
$(
mktemp
-d
--suffix
=
caucase_sh
)
"
caucased_dir
=
"
$tmp_dir
/caucased"
caucased
--db
"
$caucased_dir
/db.sqlite"
--netloc
"
$netloc
"
&
caucased_pid
=
"
$!
"
trap
"kill
\"
$caucased_pid
\"
; wait; rm -rf
\"
$tmp_dir
\"
"
EXIT
if
cd
"
$tmp_dir
"
;
then
:
else
echo
'Could not setup temporary directory'
fi
_main
--ca-url
"http://
$netloc
"
--update-user
if
[
-r
cas.crt.pem
]
;
then
echo
'cas.crt.pem not created'
return
1
fi
if
[
-r
cau.crt.pem
]
;
then
echo
'cau.crt.pem not created'
return
1
fi
}
if
[
"$#"
-gt
0
]
&&
[
"x
$1
"
=
'x--test'
]
;
then
if
[
"$#"
-eq
1
]
;
then
_test
"localhost:8000"
elif
[
"$#"
-eq
2
]
;
then
_test
"
$2
"
else
echo
'Usage: --test [<hostname/address>:<port>]'
return
1
fi
else
_main
"
$@
"
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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