Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign コマンドで失敗しても *.sig ファイルが作成されてしまう #34

Closed
KEINOS opened this issue Jun 2, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@KEINOS
Copy link
Member

KEINOS commented Jun 2, 2021

sign コマンドで、引数のパスが間違えていても *.sig ファイルが作成されてしまいます。(Issue #31 (comment) より)

  • 再現テスト
#shellcheck shell=sh

Describe 'sign with unexisting key'
    name_file_to_sign="dummy.txt"
    path_file_sig_out="${SHELLSPEC_TMPDIR}/${name_file_to_sign}.sig"

    It 'should print err with status 1 and should not create .enc file'
        When call sign KEINOS '/path/to/unknown/key.pub' "$name_file_to_sign" "$path_file_sig_out"

        The stdout should include '署名ファイルを生成できませんでした'
        The stderr should include 'No such file or directory'
        The status should be failure # status is 1-255

        Path file_sig="$path_file_sig_out"
        The path file_sig should not be exist
    End
End

- 実行結果

$ shellspec ./tests/issue31_test.sh
Running: /bin/sh [sh]
F

Examples:
  1) sign with unexisting key should print err with status 1 and should not create .enc file
     When call sign KEINOS /path/to/unknown/key.pub dummy.txt /tmp/dummy.txt.sig

     1.1) The path file_sig should not be exist

            The specified path exists
            path: /tmp/dummy.txt.sig

          # tests/issue31_test.sh:13

Finished in 0.37 seconds (user 0.10 seconds, sys 0.08 seconds)
1 example, 1 failure


Failure examples / Errors: (Listed here affect your suite's status)

shellspec tests/issue31_test.sh:7 # 1) sign with unexisting key should print err with status 1 and should not create .enc file FAILED
@KEINOS KEINOS added the bug Something isn't working label Jun 2, 2021
@yoshi389111 yoshi389111 self-assigned this Jun 3, 2021
@yoshi389111
Copy link
Collaborator

これやります

yoshi389111 added a commit to yoshi389111/QiiCipher that referenced this issue Jun 3, 2021
@KEINOS KEINOS added the WIP There is a draft PR for this label Jun 3, 2021
yoshi389111 added a commit to yoshi389111/QiiCipher that referenced this issue Jun 3, 2021
@KEINOS KEINOS closed this as completed in e5ba489 Jun 3, 2021
@KEINOS KEINOS removed the WIP There is a draft PR for this label Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants