Commit aa45935f authored by Roman Lacko's avatar Roman Lacko
Browse files

Add ability to disable uploads

parent abd0d411
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -88,6 +88,9 @@ OPTIONS
  Do not use `-U` for the first time when running the script, as the repository
  must be cloned to be used.

* '-x', '-X'
  Enable (default) or disable uploading of the result.

* `-f`:
  Do not check user identity. The script will not complain if not run by root.
  It will also not complain when root attempts to compile sources directly.
+10 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ run_container() {
        exit 1
    fi

    if [ -f "${target}.zip" ]; then
    if [ "${upload}" -eq 1 ] && [ -f "${target}.zip" ]; then
        # The parameters for upload were obtained from here:
        # https://github.com/danzatt/tpm2_algtest_ui/blob/master/tpm2-algtest-ui.py#L176
        curl --silent -X POST \
@@ -227,8 +227,9 @@ run_container() {
run_mode=host
check_privileged=${TPM2_ALGTEST_WRAP_CHECK_PRIVILEGED:-1}
update=${TPM2_ALGTEST_WRAP_UPDATE:-1}
upload=${TPM2_ALGTEST_WRAP_UPLOAD:-1}

while getopts "hi:fuU" option; do
while getopts "hi:fuUxX" option; do
    case "${option}" in
    h)
        help
@@ -246,6 +247,12 @@ while getopts "hi:fuU" option; do
    U)
        update=0
        ;;
    x)
        upload=1
        ;;
    X)
        upload=0
        ;;
    *)
        usage
        exit 1
@@ -285,6 +292,7 @@ if [ "${run_mode}" = 'host' ]; then
    # Export these symbols for instances of this script that may be called here.
    export TPM2_ALGTEST_WRAP_CHECK_PRIVILEGED=${check_privileged}
    export TPM2_ALGTEST_WRAP_UPDATE=${update}
    export TPM2_ALGTEST_WRAP_UPLOAD=${upload}

    run_host
elif [ "${run_mode}" = 'container' ]; then