The Cyara Database Utility Tool is used to manage test results and their associated media files. The tool can be run against results and used to purge or update the results, and move, detach, or delete the associated media files. The tool can also be run against a media file location, and used to move or delete these files and update the associated database.
It takes arguments and configuration in two ways. There are the immediate command line options that could be different each time it is executed. There is also a configuration file for those options that are not expected to change. This includes the Platform database and Security settings.
When running against test results, the Cyara Database Utility Tool
generates a summary of results that will be included in the operation before
requesting permission to proceed (unless the
–yes
option is used to automatically proceed).
User Credentials
After you install the Cyara Database Utility Tool, you need to set the user credentials. When you install the Cyara Database Utilities installer, the Cyara Database Utility Tool is installed. Refer to the Cyara Deployment Guide for installation steps.
Configuring the Cyara Database Utility Tool
The Database Utility Tool configuration is controlled by the contents
of the
Cyara.Database.Utils.Tool.exe.config
file.
- In the
Cyara.Database.Utils.Tool.exe.config
file, update the<secureAppSettings>
section. User credentials needed for the Cyara Platform or mounting any source folders or destination folders can be set on the command line or in the config file.An example of the user credentials being set in the configuration file is given below:<secureAppSettings> <add key="CyaraUsername" value="admin" /> <add key="CyaraPassword" value="password" /> <add key="SourceFolderUsername" value="administrator" /> <add key="SourceFolderPassword" value="sharepassword" /> <add key="DestFolderUsername" value="administrator" /> <add key="DestFolderPassword" value="sharepassword" /> </secureAppSettings>
The
CyaraUsername
(-u
) andCyaraPassword
(--up
) set the credentials for the Cyara Platform User used by the Cyara Database Utility, which is used to verify access to the accounts included in the job.The
SourceFolderUsername
(--su
) and theSourceFolderPassword
(--sup
) are the credentials that the Cyara Database Utility will use to mount any source shares it needs to move or delete recordings.The
DestFolderUsername
(--du
) andDestFolderPassword
(--dup
) are the credentials that the Cyara Database Utility will use to mount and destination shares it needs to move recordings. -
Update the
<connectionStrings>
section with the connection details for the Microsoft SQL Server Database if the details entered during setup were incorrect or have changed.<connectionStrings> <add name="DefaultContext" connectionString="DATA SOURCE= db_host_ip;INITIAL CATALOG= cyaradb;USER ID=cyaraportal;PASSWORD=password;PERSIST SECURITY INFO=True" providerName= "System.Data.SqlClient"/> </connectionStrings>
- Update the
<appSettings>
section with the location of the identity server used for authentication<add key="IdentityClientSettings.IdentityServerUrl" value="http://localhost/CyaraWebIdentity" />
- Save the
Cyara.Database.Utils.Tool.exe.config
file with these changes.
Cloud Storage
The current
Cyara.Storage
service is capable of handling local
files, the old media storage files and now cloud files. You can force all file
operations through the Storage Service by uncommenting and setting the
DatabaseUtilsSettings.ForceCloudStorage
value to true
in the config file. This will cause the Cyara Database Utility to perform all
file operations through
Cyara.Storage
. If you are using this option, then
certain jobs and job types will not work as expected.
For example, the Cyara Database Utility does not support moving cloud stored files from one location to another cloud location. We do not recommend using a detach job for cloud stored resources at this time as managing the orphaned files will be more difficult than for file stored resources.
Encrypting User Credential Configuration
To encrypt the run purge user credentials in the configuration file, follow these steps:
- Copy
Cyara.Database.Utils.Tool.exe.config
toCyara.Database.Utils.Tool.exe.Config.original
- Edit the configuration and add the secure app settings for the user credentials
- Rename
Cyara.Database.Utils.Tool.exe.config
toweb.config
- To encrypt the
configuration file, run the following command:
-
aspnet_regiis -pef connectionStrings.-prov DataProtectionConfigurationProvider
The
aspnet_regiis
tool is part of the .NET framework and is in the following location:<install drive>:\Windows\Microsoft.NET\Framework\<Framework version>\
-
aspnet_regiis -pef secureAppSettings.-prov DataProtectionConfigurationProvider
-
- Rename the
web.config
file toApp.config
.
Command Line Options
Cyara.Database.Utils.Tool.exe [OPTIONS]
where
[OPTIONS]
can be as follows:
[OPTIONS] | Description |
-a, --account-id=VALUE | Identifier of the Account where results should be selected |
--age=VALUE |
[<days>d] [<hours>h] [<minutes>m]
[<seconds>s] : All results older than d days, H hours, m minutes,
and s seconds will be included
|
--cr, --campaign-runs | Select Campaign runs |
--dp, --pause=VALUE | The amount of time (in milliseconds) to pause between calls to the database. For example: 500 |
--dps | Delete page size. For example: 500 |
-d, --delete | Delete recording files |
--du, --dest-user=VALUE | Username to mount destination folders for moving recordings (if omitted it will be prompted for) |
--dup, --dest-user-password=VALUE | Password to mount destination folders for moving recordings (if omitted it will be prompted for) |
-e, --end-date=VALUE |
"<YYYYMMDD> [hh:mm:ss]" : All results
belonging to specified account older than the end date may be included
|
--fps | Fetch page size. For example: 500 |
-h, --help, -? | Show help and exit |
-l, --include-last | Include runs even if it is the last run of a Campaign |
-i, --run-ids=VALUE | Comma separated list of Campaign run identifiers that should be included |
--job=VALUE | Specify the function for this job
purge: Remove selected entities from database update: Update media locations in database detach: Remove media references from database file: Process files and folders in the source |
--source=VALUE | Source folder to process for file job |
-m, --move=VALUE | Move recording files to specified folder |
-n, --account-name=VALUE | Name of Account where results should be selected |
--or, --orphans | Select orphans |
-s, --start-date=VALUE |
"<YYYYMMDD> [hh:mm:ss]" : All results
belonging to specified Account younger than the start date may be included
|
--su, --source-user=VALUE | Username to mount folders containing recordings (if omitted it will be prompted for) |
--sup, --source-user-password=VALUE | Password to mount folders containing recordings (if omitted it will be prompted for) |
--tcv, --validations | Select Test Case validations |
-u, --portal-user=VALUE | Portal Account login to use (if omitted it will be prompted for) |
--up, --portal-user-password=VALUE | Portal Account password to use (if omitted it will be prompted for) |
-x, --exclude=VALUE | Exclude some Accounts when all Accounts are being selected |
--missing, --missing=VALUE | Specify the action for missing media resources: ignore, or detach. Default is error |
-y, --yes | Assumes yes and continues. If this option is set, then there is no prompt for any user confirmation. Mostly used in scheduling the utility to run without user interaction |
- Purge
- This is to used to remove result records for Campaign runs and Test Case validations. This can also optionally delete or move the media recordings.
- Update
- This is used when you wish to move the media for results and keep
the results.
For example,
To move the files for an account to a separate location:
Cyara.Database.Utils.Tool.exe --job=update --move=\\share\account\folder --account-id=1 --campaign-runs --validations --orphans --include-last
This will move all media files for account id 1 for all Campaign runs, validations, and orphaned results into the destination location. And then update the database result records to point to the new location. This could be used to move a large account's files to a separate share.
- Detach
- This is where you wish to keep the results but remove any
reference to the media in the results so that it is no longer available through
the reports, and optionally move the media.
For example,
To archive the files for an account, but keep the results:
Cyara.Database.Utils.Tool.exe --job=detach --move=\\share\archive\folder --account-id=1 --campaign-runs --validations --orphans --include-last
This will move all media files for account id 1 for all Campaign runs, validations, and orphaned results into the destination location, which could be an offline archive share. And then detach the records from the media files (set to null) so that the results remain, but is no longer linked to the media files.
To delete the files for an account that are older than a specified age:Cyara.Database.Utils.Tool.exe --job=detach --delete --account‐id=1 --campaign‐runs --validations --orphans --age=365d
This will delete the media files for account id 1 for all Campaign runs, validations, and orphaned results into the destination location that are older than a year (356 days old). And then detach the records from the media files (set to null) so that the results remain, but is no longer linked to the media files. This could be used to free up space where old recordings are no longer required, but the results are still wanted (so not purged).
- File
-
This is used to process all the files in a given location, move or delete them, and keeps the records up to date with any changes made to the media.
If moving, then the move destination option must be set, and any results that reference the files will be updated to point to the new location. Any file that is not found in the database (a result recording) will be moved into a
special _orphan
folder in the move destination.If deleting, then the delete (
-d
) option must be set. All files in that location will be removed, and any results that reference the files will be have these references removed.When using the file job, no other result, account, or time options are allowed.
For example,
To delete all files from one folder and all subfolders:
Cyara.Database.Utils.Tool.exe --job=file --source=\\share\source\folder --delete
To move all files from one folder (and all subfolders) to another:
Cyara.Database.Utils.Tool.exe --job=file --source=\\share\source\folder --move=\\newshare\destination\folder
Comments
0 comments
Please sign in to leave a comment.