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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vincent Pelletier
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
Show 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
...
@@ -1109,5 +1109,49 @@ EOF
fi
fi
fi
fi
}
}
_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
"
$@
"
_main
"
$@
"
fi
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