Class FuzzJobRunner


  • public class FuzzJobRunner
    extends Object
    This class handles the process of starting a fuzz test with Defensics and monitoring its progress.
    • Constructor Detail

      • FuzzJobRunner

        public FuzzJobRunner()
        Default constructor.

        TODO: Check later if this can be augmented to take all related service objects as constructor arguments so writing unit tests would be cleaner. Some related service objects require jenkinsRun information etc., so need to check how this object lifecycle goes.

    • Method Detail

      • run

        public void run​(Run<?,​?> jenkinsRun,
                        FilePath workspace,
                        Launcher launcher,
                        Logger logger,
                        FilePath testPlan,
                        String configurationOverrides,
                        InstanceConfiguration instanceConfiguration,
                        boolean saveResultPackage)
                 throws AbortException
        Run fuzz tests with Defensics and publish resulting HTML report.
        Parameters:
        jenkinsRun - Jenkins run that started this.
        workspace - Workspace of Jenkins job.
        launcher - Launcher of Jenkins run.
        testPlan - Fuzz testing is done according to this plan.
        configurationOverrides - String containing configuration overrides
        instanceConfiguration - Configuration for Defensics instance that should run the tests.
        saveResultPackage - Download and save result package for Defensics run?
        Throws:
        AbortException
      • publishResults

        public void publishResults​(Run<?,​?> jenkinsRun,
                                   Run defensicsRun,
                                   FilePath workspace,
                                   String testPlanName)
                            throws Exception
        Publish results. Handles publishing HTML report and adding actions to both build and job level.
        Parameters:
        jenkinsRun - The Jenkins run whose results are being published
        defensicsRun - The Defensics run whose results are being published
        workspace - Jenkins workspace, used to temporarily store report files.
        testPlanName - Testplan filename. This is used as title for the report tab, which helps identify results if there are multiple Defensics steps in the Jenkins job.
        Throws:
        DefensicsRequestException - If server responds with error
        IOException - If deleting the temporary report files in workspace fails
        InterruptedException - If deleting the temporary report files in workspace is interrupted.
        Exception
      • publishResultPackage

        public void publishResultPackage​(Run<?,​?> jenkinsRun,
                                         Run defensicsRun,
                                         FilePath testPlan)
                                  throws Exception
        Downloads and archives result package for the test run. Adds action to provide html link in the build results.
        Parameters:
        jenkinsRun - Jenkins run
        defensicsRun - Defensics run
        testPlan - Originally used test plan file to construct result-package file name
        Throws:
        Exception - See saveResultPackage for possible exceptions