Skip to content

Commit 5449ec6

Browse files
committed
Add containers realtime scan functionality and related constants
1 parent 268ebd2 commit 5449ec6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main/wrapper/CxWrapper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ export class CxWrapper {
168168
return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.SCAN_OSS);
169169
}
170170

171+
async containersRealtimeScanResults(sourceFile: string): Promise<CxCommandOutput> {
172+
const commands: string[] = [CxConstants.CMD_SCAN, CxConstants.CMD_CONTAINERS_REALTIME, CxConstants.SOURCE, sourceFile];
173+
commands.push(...this.initializeCommands(false));
174+
const exec = new ExecutionService();
175+
return await exec.executeCommands(this.config.pathToExecutable, commands, CxConstants.SCAN_CONTAINERS_REALTIME);
176+
}
177+
171178
async secretsScanResults(sourceFile: string, ignoredFilePath?: string): Promise<CxCommandOutput> {
172179
const commands: string[] = [
173180
CxConstants.CMD_SCAN,

src/tests/ScanTest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ describe("ScanCreate cases", () => {
227227
expect(cxCommandOutput.exitCode).toBe(0);
228228
});
229229

230-
it.skip('ScanContainersRealtime Successful case', async () => {
230+
it('ScanContainersRealtime Successful case', async () => {
231231
const wrapper = new CxWrapper(cxScanConfig);
232232
const cxCommandOutput: CxCommandOutput = await wrapper.containersRealtimeScanResults("src/tests/data/Dockerfile");
233233
console.log("Json object from scanContainersRealtime successful case: " + JSON.stringify(cxCommandOutput));

0 commit comments

Comments
 (0)