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
87cae25c
Commit
87cae25c
authored
Feb 12, 2021
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell/caucase.sh: Factorise self-test failure codepath.
parent
e5e13cd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
shell/caucase.sh
shell/caucase.sh
+12
-18
No files found.
shell/caucase.sh
View file @
87cae25c
...
@@ -1190,6 +1190,12 @@ EOF
...
@@ -1190,6 +1190,12 @@ EOF
caucased_dir
\
caucased_dir
\
caucased_type
\
caucased_type
\
caucased_pid
caucased_pid
_fail
()
{
# shellcheck disable=SC2059
printf
"
$@
"
find
.
-ls
exit
1
}
echo
'Automated testing...'
echo
'Automated testing...'
if
command
-v
caucased
>
/dev/null
;
then
if
command
-v
caucased
>
/dev/null
;
then
caucased_type
=
"path"
caucased_type
=
"path"
...
@@ -1288,29 +1294,21 @@ EOF
...
@@ -1288,29 +1294,21 @@ EOF
|
sed
's/\s.*//'
\
|
sed
's/\s.*//'
\
)
"
)
"
if
[
!
-d
cas_crt
]
;
then
if
[
!
-d
cas_crt
]
;
then
echo
'cas_crt not created'
_fail
'cas_crt not created\n'
find
.
-ls
return
1
fi
fi
for
cas_file
in
cas_crt/
*
;
do
for
cas_file
in
cas_crt/
*
;
do
if
[
-r
"
$cas_file
"
]
&&
[
!
-h
"
$cas_file
"
]
;
then
if
[
-r
"
$cas_file
"
]
&&
[
!
-h
"
$cas_file
"
]
;
then
if
[
"
$cas_found
"
-eq
1
]
;
then
if
[
"
$cas_found
"
-eq
1
]
;
then
echo
'Multiple CAS CA certificates found'
_fail
'Multiple CAS CA certificates found\n'
find
.
-ls
return
1
fi
fi
cas_found
=
1
cas_found
=
1
fi
fi
done
done
if
[
"
$cas_found
"
-eq
0
]
;
then
if
[
"
$cas_found
"
-eq
0
]
;
then
echo
'No CAS CA certificates found, but directory exists'
_fail
'No CAS CA certificates found, but directory exists\n'
find
.
-ls
return
1
fi
fi
if
[
!
-f
cau.crt.pem
]
;
then
if
[
!
-f
cau.crt.pem
]
;
then
echo
'cau.crt.pem not created'
_fail
'cau.crt.pem not created\n'
find
.
-ls
return
1
fi
fi
echo
'Retrieving auto-issued user certificate...'
echo
'Retrieving auto-issued user certificate...'
if
_main
\
if
_main
\
...
@@ -1321,9 +1319,7 @@ EOF
...
@@ -1321,9 +1319,7 @@ EOF
then
then
:
:
else
else
echo
'Failed to receive signed user certificate.'
_fail
'Failed to receive signed user certificate.\n'
find
.
-ls
return
1
fi
fi
echo
'Using the user certificate...'
echo
'Using the user certificate...'
if
_main
\
if
_main
\
...
@@ -1334,9 +1330,7 @@ EOF
...
@@ -1334,9 +1330,7 @@ EOF
>
/dev/null
;
then
>
/dev/null
;
then
:
:
else
else
echo
'Failed to list pending CSR, authentication failed ?'
_fail
'Failed to list pending CSR, authentication failed ?\n'
find
.
-ls
return
1
fi
fi
echo
'Success'
echo
'Success'
}
}
...
...
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