Bug 520588

Summary: Sectool --info throws traceback
Product: [Fedora] Fedora Reporter: Eduard Benes <ebenes>
Component: sectoolAssignee: Maros Barabas <mbarabas>
Status: CLOSED RAWHIDE QA Contact: Eduard Benes <ebenes>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dkopecek, jhrozek, mvadkert, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-09 14:31:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 519819    
Attachments:
Description Flags
File assignment patch
none
This patch fixes checking of empty suite in --info action none

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