mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Improve integration test uploadToProvider.sh
* Remove `let` from the script as it will return 1 (signalling an error) on the first iteration, which will stop the script when in `set -e` mode. It also is unnecessary, as the increment can be done at the place of usage directly. * Added a "remainder aka modulo" division, otherwise there will be no TLP option set, once we run out of the four entries in the TLSs list. * (Style) remove superfluous semicolons.
This commit is contained in:
parent
2fbe0fed7e
commit
3da37a533b
1 changed files with 8 additions and 9 deletions
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
# assumes that the following script only downloads file with filenames
|
# assumes that the following script only downloads file with filenames
|
||||||
# following https://docs.oasis-open.org/csaf/csaf/v2.0/cs01/csaf-v2.0-cs01.html#51-filename
|
# following https://docs.oasis-open.org/csaf/csaf/v2.0/cs01/csaf-v2.0-cs01.html#51-filename
|
||||||
# which are save to process further
|
# which are save to process further
|
||||||
|
|
@ -20,11 +19,11 @@ set -e
|
||||||
|
|
||||||
TLPs=("white" "green" "amber" "red")
|
TLPs=("white" "green" "amber" "red")
|
||||||
COUNTER=0
|
COUNTER=0
|
||||||
for f in $(ls csaf_examples);
|
for f in $(ls csaf_examples); do
|
||||||
do
|
../../bin-linux-amd64/csaf_uploader --insecure -P security123 -a upload \
|
||||||
../../bin-linux-amd64/csaf_uploader -a upload -t ${TLPs[$COUNTER]} \
|
-t ${TLPs[$((COUNTER++ % 4))]} \
|
||||||
-u https://localhost:8443/cgi-bin/csaf_provider.go --insecure -P security123 \
|
-u https://localhost:8443/cgi-bin/csaf_provider.go \
|
||||||
--client-cert ~/devca1/testclient1.crt --client-key ~/devca1/testclient1-key.pem \
|
--client-cert ~/devca1/testclient1.crt \
|
||||||
./csaf_examples/"$f";
|
--client-key ~/devca1/testclient1-key.pem \
|
||||||
let COUNTER++
|
./csaf_examples/"$f"
|
||||||
done;
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue