-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Update ClusterFuzzLite github->action (#356)
Update ClusterFuzzLite github->action Signed-off-by: Taras Drozdovskyi <[email protected]>
- Loading branch information
1 parent
ce2f7ae
commit 057b21d
Showing
4 changed files
with
48 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/test/java/com/lpvs/util/LPVSWebhookUtilTestFuzzer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2023, Samsung Electronics Co., Ltd. All rights reserved. | ||
* | ||
* Use of this source code is governed by a MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
package com.lpvs.util; | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
import com.code_intelligence.jazzer.junit.FuzzTest; | ||
import com.lpvs.entity.LPVSQueue; | ||
import org.junitpioneer.jupiter.SetEnvironmentVariable; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class LPVSWebhookUtilTestFuzzer { | ||
|
||
@FuzzTest(maxDuration = "60s") | ||
@SetEnvironmentVariable(key = "JAZZER_FUZZ", value = "1") | ||
public void fuzzTestGetPullRequestId(FuzzedDataProvider data) { | ||
System.setProperty("JAZZER_FUZZ", "1"); | ||
|
||
LPVSQueue webhookConfig = new LPVSQueue(); | ||
|
||
// Fuzzing input data | ||
webhookConfig.setRepositoryUrl(data.consumeRemainingAsString()); | ||
webhookConfig.setPullRequestUrl(data.consumeRemainingAsString()); | ||
|
||
// Perform the fuzz test | ||
try { | ||
String result = LPVSWebhookUtil.getPullRequestId(webhookConfig); | ||
|
||
// Validate the result | ||
assertNotNull(result); | ||
} catch (Exception e) { | ||
// Handle exceptions caused by unexpected inputs gracefully | ||
// Log the exception or perform other actions | ||
fail("| Unexpected exception: --- | " + e.getMessage()); | ||
} | ||
} | ||
} |