Bug 520588 - Sectool --info throws traceback
Summary: Sectool --info throws traceback
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sectool
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Maros Barabas
QA Contact: Eduard Benes
URL:
Whiteboard:
: 520592 (view as bug list)
Depends On:
Blocks: RHEL6Sectool
TreeView+ depends on / blocked
 
Reported: 2009-09-01 09:57 UTC by Eduard Benes
Modified: 2009-09-09 14:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-09 14:31:01 UTC


Attachments (Terms of Use)
File assignment patch (943 bytes, patch)
2009-09-01 12:04 UTC, Maros Barabas
no flags Details | Diff
This patch fixes checking of empty suite in --info action (1.68 KB, patch)
2009-09-01 12:25 UTC, Maros Barabas
no flags Details | Diff

Description Eduard Benes 2009-09-01 09:57:10 UTC
Description of problem:
# sectool --version
sectool 0.9.4

# sectool --info
Traceback (most recent call last):
  File "/usr/sbin/sectool", line 513, in <module>
    main(sys.argv)
  File "/usr/sbin/sectool", line 509, in main
    base.run(options, args)
  File "/usr/sbin/sectool", line 461, in run
    if os.path.exists(file): os.remove(file)
UnboundLocalError: local variable 'file' referenced before assignment
# echo $?
1

# sectool --info aaa
# echo $?
0


Version-Release number of selected component (if applicable):
sectool-0.9.4-1

How reproducible:
always

Steps to Reproduce:
1. $ sectool --info
  
Actual results:
throws traceback

Expected results:
no traceback

Additional info:
It is also up to discussion that running sectool on non-existing test
should return non-zero return code. For example running 
 $ sectool --info unkownTestPluginName 
should exit with code 1>= and not with 0 as it does now to indicate the failure to find info for requested test.

Comment 1 Miroslav Vadkerti 2009-09-01 10:13:13 UTC
To additional info:
Also it would be nice if sectool would print an error or info message when the test doesn't exit not just end without any output.

Comment 2 Maros Barabas 2009-09-01 12:04:11 UTC
Created attachment 359377 [details]
File assignment patch

Comment 3 Maros Barabas 2009-09-01 12:05:12 UTC
(In reply to comment #1)
> To additional info:
> Also it would be nice if sectool would print an error or info message when the
> test doesn't exit not just end without any output.  

Current status: 

$ sectool --run NotAnTest
Error: No matching tests to run

Comment 4 Maros Barabas 2009-09-01 12:24:33 UTC
*** Bug 520592 has been marked as a duplicate of this bug. ***

Comment 5 Maros Barabas 2009-09-01 12:25:48 UTC
Created attachment 359379 [details]
This patch fixes checking of empty suite in --info action

Comment 6 Maros Barabas 2009-09-01 12:27:09 UTC
> # sectool --info aaa
> # echo $?
> 0
> Additional info:
> It is also up to discussion that running sectool on non-existing test
> should return non-zero return code. For example running 
>  $ sectool --info unkownTestPluginName 
> should exit with code 1>= and not with 0 as it does now to indicate the failure
> to find info for requested test.  

Current status:
$ sectool --info aaa
Error: No matching tests to run


Note You need to log in before you can comment on or make changes to this bug.