Demo/Lab: Pstee and replaying operations on connectors
In this lab we learn about how to "pstee" a connector and how to replay the resulting operation from a pstee file on that connector. This is useful when incrementally developing and testing your changes without having to reproduce the often complicated steps in the UI. Instead, the intent is to only do the complicated steps once to produce a pstee input kvgroup file and use the resulting file to reproduce the execution of your connector manually on the command line.
If state changes during the execution of a connector, it is often necessary to use multiple input kvg files to transition an object back to its original state. Some examples could include a test case like testing a reset operation, followed by a verify operation to ensure the password change happened correctly, then another reset operation to ensure that the accounts password is changed back to something different from the original reset operation.
With an understanding of the format of these files, you may also edit their contents and use them to test different operations or differing behavior. These files can be stored and replayed for a full day, at which point the license contained within expires and you must reproduce the steps again to produce another input kvg file.
When implementing the create and update operation, you will find input kvgroup files particularly useful. Generally, the steps necessary to execute the create and update operation are complex. It is often easier to prototype the target attributes and their values and sequence numbers using an input kvgroup file, then use these to configure the product target attributes and profile attributes that are set in workflow.
Prerequisites
Use the target configured in Demo/Lab: Targeting with SQLite example .
Steps
Open the
agtsqlitedemo.py
script using an editor of your choice.Break the SQLite connector script by typing broken into the listusers function so the code appears as:
def listusers(cinfo, wantGroups, wantAttributes): conn=sqliteJ.connect(dbcase) c = conn.cursor() c.execute(’SELECT is FROM accountsbroken’)
Save the file.
Rotate the logs in the command prompt:
In a command prompt being run "as administrator", navigate to <Program Files path>\Bravura Security\Bravura Security Fabric\<instance>\ directory.
Run command:
instance.bat
Run command:
service\idmlogsvc.exe -rotatelog
Run Auto discovery in the Bravura Security Fabric UI
Look at the <Program Files path>\Bravura Security\Bravura Security Fabric\Logs\<instance> directory; there will be several new files for
-input.log
and-output.log
.Open
idmsuite.log
file.Search the logs for an error message stating:
Error: Error: A Python Exception Occurred of Type [OperationalError] Message: [no such table: accountsbroken]
Use the input KVGroup file to speed up the debugging process.
Fix the SQLite connector script by removing the "broken" from the listusers function so the code appears as:
def listusers(cinfo, wantGroups, wantAttributes): conn=sqliteJ.connect(dbcase) c = conn.cursor() c.execute(’SELECT is FROM accounts’)
Save the file.
Copy the contents of the latest
-input.log
fileObtain an Instance Prompt (see Instance Prompt )
Navigate to the <instance>\agent\ directory and run command:
agtpython
Paste the contents of the
-intput
.log file.
Notice that the listusers function now succeeds and returns the list of six users since we have fixed the agtsqlitedemo.py script.