saltstack reqExecSls implemented as adaptor
[ccsdk/sli/adaptors.git] / saltstack-adapter / saltstack-adapter-provider / src / test / java / org / onap / appc / adapter / impl / TestSaltstackAdapterImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.adapter.impl;
26
27 import org.junit.After;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.onap.ccsdk.sli.adaptors.saltstack.impl.SaltstackAdapterImpl;
31 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
32 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
33
34 import java.util.HashMap;
35 import java.util.Map;
36
37 import static org.junit.Assert.assertEquals;
38 import static org.junit.Assert.fail;
39
40
41 public class TestSaltstackAdapterImpl {
42
43     private final String PENDING = "100";
44     private final String SUCCESS = "400";
45     private String message = "{\"Results\":{\"192.168.1.10\":{\"Id\":\"101\",\"StatusCode\":200,\"StatusMessage\":\"SUCCESS\"}},\"StatusCode\":200,\"StatusMessage\":\"FINISHED\"}";
46
47     private SaltstackAdapterImpl adapter;
48     private String TestId;
49     private boolean testMode = true;
50     private Map<String, String> params;
51     private SvcLogicContext svcContext;
52
53
54     @Before
55     public void setup() throws IllegalArgumentException {
56         testMode = true;
57         svcContext = new SvcLogicContext();
58         adapter = new SaltstackAdapterImpl(testMode);
59
60         params = new HashMap<>();
61         params.put("AgentUrl", "https://192.168.1.1");
62         params.put("User", "test");
63         params.put("Password", "test");
64     }
65
66     @After
67     public void tearDown() {
68         testMode = false;
69         adapter = null;
70         params = null;
71         svcContext = null;
72     }
73
74     @Test(expected = SvcLogicException.class)
75     public void reqExecCommand_shouldSetFailed() throws SvcLogicException,
76             IllegalStateException, IllegalArgumentException {
77
78         params.put("HostName", "test");
79         params.put("Port", "10");
80         params.put("User", "test");
81         params.put("Password", "test");
82         params.put("Test", "fail");
83             adapter.reqExecCommand(params, svcContext);
84             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
85             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
86             assertEquals("101", status);
87     }
88
89     @Test(expected = SvcLogicException.class)
90     public void reqExecCommand_shouldSetUserFailed() throws SvcLogicException,
91             IllegalStateException, IllegalArgumentException {
92
93         params.put("HostName", "test");
94         params.put("Port", "10");
95         params.put("Password", "test");
96         params.put("Test", "fail");
97         adapter.reqExecCommand(params, svcContext);
98         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
99         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
100         assertEquals("101", status);
101     }
102
103     @Test(expected = SvcLogicException.class)
104     public void reqExecCommand_shouldSetHostFailed() throws SvcLogicException,
105             IllegalStateException, IllegalArgumentException {
106
107         params.put("Port", "10");
108         params.put("User", "test");
109         params.put("Password", "test");
110         params.put("Test", "fail");
111         adapter.reqExecCommand(params, svcContext);
112         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
113         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
114         assertEquals("101", status);
115     }
116
117     @Test(expected = SvcLogicException.class)
118     public void reqExecCommand_shouldSetPortFailed() throws SvcLogicException,
119             IllegalStateException, IllegalArgumentException {
120
121         params.put("HostName", "test");
122         params.put("User", "test");
123         params.put("Password", "test");
124         params.put("Test", "fail");
125         adapter.reqExecCommand(params, svcContext);
126         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
127         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
128         assertEquals("101", status);
129     }
130
131     @Test(expected = SvcLogicException.class)
132     public void reqExecCommand_shouldSetPasswordFailed() throws SvcLogicException,
133             IllegalStateException, IllegalArgumentException {
134
135         params.put("HostName", "test");
136         params.put("Port", "10");
137         params.put("User", "test");
138         params.put("Test", "fail");
139         adapter.reqExecCommand(params, svcContext);
140         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
141         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
142         assertEquals("101", status);
143     }
144
145     @Test(expected = SvcLogicException.class)
146     public void reqExecCommand_shouldSetMandatoryFailed() throws SvcLogicException,
147             IllegalStateException, IllegalArgumentException {
148
149         params.put("Test", "fail");
150         adapter.reqExecCommand(params, svcContext);
151         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
152         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
153         assertEquals("101", status);
154     }
155
156     @Test(expected = SvcLogicException.class)
157     public void reqExecCommand_NoResponseFile() throws SvcLogicException,
158             IllegalStateException, IllegalArgumentException {
159
160         params.put("HostName", "test");
161         params.put("Port", "10");
162         params.put("User", "test");
163         params.put("Password", "test");
164         params.put("Test", "success");
165         params.put("cmd", "test");
166         params.put("slsExec", "false");
167         try {
168             adapter.reqExecCommand(params, svcContext);
169             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
170             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
171             assertEquals("400", status);
172         } catch (NullPointerException e) {
173             fail(e.getMessage() + " Unknown exception encountered ");
174         }
175     }
176
177     @Test(expected = SvcLogicException.class)
178     public void reqExecCommand_NoResponseFileWithRetry() throws SvcLogicException,
179             IllegalStateException, IllegalArgumentException {
180
181         params.put("HostName", "test");
182         params.put("Port", "10");
183         params.put("User", "test");
184         params.put("Password", "test");
185         params.put("Test", "success");
186         params.put("retryDelay", "10");
187         params.put("retryCount", "10");
188         params.put("cmd", "test");
189         params.put("slsExec", "false");
190         try {
191             adapter.reqExecCommand(params, svcContext);
192             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
193             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
194             assertEquals("400", status);
195         } catch (NullPointerException e) {
196             fail(e.getMessage() + " Unknown exception encountered ");
197         }
198     }
199
200     @Test(expected = SvcLogicException.class)
201     public void reqExecCommand_NoResponseFileWithRetryZero() throws SvcLogicException,
202             IllegalStateException, IllegalArgumentException {
203
204         params.put("HostName", "test");
205         params.put("Port", "10");
206         params.put("User", "test");
207         params.put("Password", "test");
208         params.put("Test", "success");
209         params.put("retryDelay", "0");
210         params.put("retryCount", "0");
211         params.put("cmd", "test");
212         params.put("slsExec", "false");
213         try {
214             adapter.reqExecCommand(params, svcContext);
215             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
216             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
217             assertEquals("400", status);
218         } catch (NullPointerException e) {
219             fail(e.getMessage() + " Unknown exception encountered ");
220         }
221     }
222
223     @Test(expected = SvcLogicException.class)
224     public void reqExecCommand_NoResponseFileWithNoRetry() throws SvcLogicException,
225             IllegalStateException, IllegalArgumentException {
226
227         params.put("HostName", "test");
228         params.put("Port", "10");
229         params.put("User", "test");
230         params.put("Password", "test");
231         params.put("Test", "success");
232         params.put("retryDelay", "-1");
233         params.put("retryCount", "-1");
234         params.put("cmd", "test");
235         params.put("slsExec", "false");
236
237         try {
238             adapter.reqExecCommand(params, svcContext);
239             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
240             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
241             assertEquals("400", status);
242         } catch (NullPointerException e) {
243             fail(e.getMessage() + " Unknown exception encountered ");
244         }
245     }
246
247     @Test(expected = SvcLogicException.class)
248     public void reqExecCommand_shouldSetFailure() throws SvcLogicException,
249             IllegalStateException, IllegalArgumentException {
250
251         params.put("HostName", "test");
252         params.put("Port", "10");
253         params.put("User", "test");
254         params.put("Password", "test");
255         params.put("cmd", "test");
256         params.put("slsExec", "test");
257         params.put("Test", "fail");
258         try {
259             adapter.reqExecCommand(params, svcContext);
260             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
261             TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
262             assertEquals("400", status);
263         } catch (NullPointerException e) {
264             fail(e.getMessage() + " Unknown exception encountered ");
265         }
266     }
267
268     @Test
269     public void reqExecCommand_shouldSetSuccessNoSLS() throws SvcLogicException,
270             IllegalStateException, IllegalArgumentException {
271
272         params.put("HostName", "test");
273         params.put("Port", "10");
274         params.put("User", "test");
275         params.put("Password", "test");
276         params.put("Test", "success");
277         params.put("fileName", "src/test/resources/test.json");
278         params.put("Id", "test1");
279         params.put("cmd", "test");
280         params.put("slsExec", "false");
281
282         adapter.reqExecCommand(params, svcContext);
283         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
284         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
285         assertEquals("250", status);
286         assertEquals(TestId, "test1");
287     }
288
289     @Test
290     public void reqExecCommand_shouldSetSuccessExecSLS() throws SvcLogicException,
291             IllegalStateException, IllegalArgumentException {
292
293         params.put("HostName", "test");
294         params.put("Port", "10");
295         params.put("User", "test");
296         params.put("Password", "test");
297         params.put("Test", "success");
298         params.put("fileName", "src/test/resources/test-sls.json");
299         params.put("Id", "test1");
300         params.put("cmd", "test");
301         params.put("slsExec", "true");
302
303         adapter.reqExecCommand(params, svcContext);
304         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
305         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
306         assertEquals("200", status);
307         assertEquals(TestId, "test1");
308     }
309
310     @Test(expected = SvcLogicException.class)
311     public void reqExecCommand_shouldSetFailExecSLS() throws SvcLogicException,
312             IllegalStateException, IllegalArgumentException {
313
314         params.put("HostName", "test");
315         params.put("Port", "10");
316         params.put("User", "test");
317         params.put("Password", "test");
318         params.put("Test", "success");
319         params.put("fileName", "src/test/resources/test.json");
320         params.put("Id", "test1");
321         params.put("cmd", "test");
322         params.put("slsExec", "true");
323
324         adapter.reqExecCommand(params, svcContext);
325         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
326         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
327         assertEquals(TestId, "test1");
328     }
329
330     @Test
331     public void reqExecCommand_shouldSetSuccessFileTxt() throws SvcLogicException,
332             IllegalStateException, IllegalArgumentException {
333
334         params.put("HostName", "test");
335         params.put("Port", "10");
336         params.put("User", "test");
337         params.put("Password", "test");
338         params.put("Test", "success");
339         params.put("fileName", "src/test/resources/test.txt");
340         params.put("Id", "txt");
341         params.put("cmd", "test");
342         params.put("slsExec", "false");
343
344         adapter.reqExecCommand(params, svcContext);
345         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
346         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
347         assertEquals("250", status);
348         assertEquals(TestId, "txt");
349     }
350
351     @Test
352     public void reqExecCommand_shouldSetSuccessFileNoExtension() throws SvcLogicException,
353             IllegalStateException, IllegalArgumentException {
354
355         params.put("HostName", "test");
356         params.put("Port", "10");
357         params.put("User", "test");
358         params.put("Password", "test");
359         params.put("Test", "success");
360         params.put("fileName", "src/test/resources/test");
361         params.put("Id", "txt");
362         params.put("cmd", "test");
363         params.put("slsExec", "false");
364
365         adapter.reqExecCommand(params, svcContext);
366         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
367         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
368         assertEquals("250", status);
369         assertEquals(TestId, "txt");
370     }
371
372     @Test
373     public void reqExecCommand_shouldSetSuccessFileInvalidJson() throws SvcLogicException,
374             IllegalStateException, IllegalArgumentException {
375
376         params.put("HostName", "test");
377         params.put("Port", "10");
378         params.put("User", "test");
379         params.put("Password", "test");
380         params.put("Test", "success");
381         params.put("fileName", "src/test/resources/test-invalid.json");
382         params.put("Id", "test1");
383         params.put("cmd", "test");
384         params.put("slsExec", "false");
385
386         adapter.reqExecCommand(params, svcContext);
387         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
388         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
389         assertEquals("250", status);
390     }
391
392     @Test(expected = SvcLogicException.class)
393     public void reqExecCommand_shouldSetFailFileInvalidFile() throws SvcLogicException,
394             IllegalStateException, IllegalArgumentException {
395
396         params.put("HostName", "test");
397         params.put("Port", "10");
398         params.put("User", "test");
399         params.put("Password", "test");
400         params.put("Test", "success");
401         params.put("fileName", "src/test/resources/test-none.json");
402         params.put("Id", "test1");
403
404         adapter.reqExecCommand(params, svcContext);
405     }
406
407     @Test
408     public void reqExecCommand_shouldSetSuccessFileJsonNoReqID() throws SvcLogicException,
409             IllegalStateException, IllegalArgumentException {
410
411         params.put("HostName", "test");
412         params.put("Port", "10");
413         params.put("User", "test");
414         params.put("Password", "test");
415         params.put("Test", "success");
416         params.put("fileName", "src/test/resources/test.json");
417         params.put("cmd", "test");
418         params.put("slsExec", "false");
419
420         adapter.reqExecCommand(params, svcContext);
421         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
422         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
423         assertEquals("250", status);
424     }
425
426     @Test
427     public void reqExecSLSFile_shouldSetSuccessJson() throws SvcLogicException,
428             IllegalStateException, IllegalArgumentException {
429
430         params.put("HostName", "test");
431         params.put("Port", "10");
432         params.put("User", "test");
433         params.put("Password", "test");
434         params.put("Test", "success");
435         params.put("slsFile", "src/test/resources/test.json");
436         params.put("fileName", "src/test/resources/test-sls.json");
437         params.put("Id", "test1");
438         params.put("cmd", "test");
439
440         adapter.reqExecSLSFile(params, svcContext);
441         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
442         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
443         assertEquals("200", status);
444         assertEquals(TestId, "test1");
445     }
446
447     @Test(expected = SvcLogicException.class)
448     public void reqExecSLSFile_NoSLSfile() throws SvcLogicException,
449             IllegalStateException, IllegalArgumentException {
450
451         params.put("HostName", "test");
452         params.put("Port", "10");
453         params.put("User", "test");
454         params.put("Password", "test");
455         params.put("Test", "success");
456         params.put("slsFile", "src/test/resources/test-none.json");
457         params.put("fileName", "src/test/resources/test-sls.json");
458         params.put("Id", "test1");
459
460         adapter.reqExecSLSFile(params, svcContext);
461         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
462         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
463         assertEquals(TestId, "test1");
464     }
465
466     @Test(expected = SvcLogicException.class)
467     public void reqExecSLSFile_NoResponsefile() throws SvcLogicException,
468             IllegalStateException, IllegalArgumentException {
469
470         params.put("HostName", "test");
471         params.put("Port", "10");
472         params.put("User", "test");
473         params.put("Password", "test");
474         params.put("Test", "success");
475         params.put("slsFile", "src/test/resources/test.json");
476         params.put("fileName", "src/test/resources/test-none.json");
477         params.put("Id", "test1");
478
479         adapter.reqExecSLSFile(params, svcContext);
480         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
481         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
482         assertEquals(TestId, "test1");
483     }
484
485     @Test
486     public void reqExecSLSFile_WithMinionSetSuccessJson() throws SvcLogicException,
487             IllegalStateException, IllegalArgumentException {
488
489         params.put("HostName", "test");
490         params.put("Port", "10");
491         params.put("User", "test");
492         params.put("Password", "test");
493         params.put("Test", "success");
494         params.put("slsFile", "src/test/resources/test.json");
495         params.put("fileName", "src/test/resources/test-sls.json");
496         params.put("Id", "test1");
497         params.put("cmd", "test");
498         params.put("applyTo", "minion1");
499
500         adapter.reqExecSLSFile(params, svcContext);
501         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
502         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
503         assertEquals("200", status);
504         assertEquals(TestId, "test1");
505     }
506
507     @Test(expected = SvcLogicException.class)
508     public void reqExecSLSFile_WithMinionNoSLSfile() throws SvcLogicException,
509             IllegalStateException, IllegalArgumentException {
510
511         params.put("HostName", "test");
512         params.put("Port", "10");
513         params.put("User", "test");
514         params.put("Password", "test");
515         params.put("Test", "success");
516         params.put("slsFile", "src/test/resources/test-none.json");
517         params.put("fileName", "src/test/resources/test-sls.json");
518         params.put("Id", "test1");
519         params.put("applyTo", "minion1");
520
521         adapter.reqExecSLSFile(params, svcContext);
522         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
523         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
524         assertEquals(TestId, "test1");
525     }
526
527     @Test(expected = SvcLogicException.class)
528     public void reqExecSLSFile_WithMinionNoResponsefile() throws SvcLogicException,
529             IllegalStateException, IllegalArgumentException {
530
531         params.put("HostName", "test");
532         params.put("Port", "10");
533         params.put("User", "test");
534         params.put("Password", "test");
535         params.put("Test", "success");
536         params.put("slsFile", "src/test/resources/test.json");
537         params.put("fileName", "src/test/resources/test-none.json");
538         params.put("Id", "test1");
539         params.put("applyTo", "minion1");
540
541         adapter.reqExecSLSFile(params, svcContext);
542         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
543         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
544         assertEquals(TestId, "test1");
545     }
546
547     @Test
548     public void reqExecSLSFile_WithAllMinionSetSuccessJson() throws SvcLogicException,
549             IllegalStateException, IllegalArgumentException {
550
551         params.put("HostName", "test");
552         params.put("Port", "10");
553         params.put("User", "test");
554         params.put("Password", "test");
555         params.put("Test", "success");
556         params.put("slsFile", "src/test/resources/test.json");
557         params.put("fileName", "src/test/resources/test-sls.json");
558         params.put("Id", "test1");
559         params.put("cmd", "test");
560         params.put("applyTo", "*");
561
562         adapter.reqExecSLSFile(params, svcContext);
563         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
564         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
565         assertEquals("200", status);
566         assertEquals(TestId, "test1");
567     }
568
569     @Test(expected = SvcLogicException.class)
570     public void reqExecSLSFile_WithAllMinionNoSLSfile() throws SvcLogicException,
571             IllegalStateException, IllegalArgumentException {
572
573         params.put("HostName", "test");
574         params.put("Port", "10");
575         params.put("User", "test");
576         params.put("Password", "test");
577         params.put("Test", "success");
578         params.put("slsFile", "src/test/resources/test-none.json");
579         params.put("fileName", "src/test/resources/test-sls.json");
580         params.put("Id", "test1");
581         params.put("applyTo", "*");
582
583         adapter.reqExecSLSFile(params, svcContext);
584         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
585         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
586         assertEquals(TestId, "test1");
587     }
588
589     @Test(expected = SvcLogicException.class)
590     public void reqExecSLSFile_WithAllMinionNoResponsefile() throws SvcLogicException,
591             IllegalStateException, IllegalArgumentException {
592
593         params.put("HostName", "test");
594         params.put("Port", "10");
595         params.put("User", "test");
596         params.put("Password", "test");
597         params.put("Test", "success");
598         params.put("slsFile", "src/test/resources/test.json");
599         params.put("fileName", "src/test/resources/test-none.json");
600         params.put("Id", "test1");
601         params.put("applyTo", "*");
602
603         adapter.reqExecSLSFile(params, svcContext);
604         String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.result.code");
605         TestId = svcContext.getAttribute("org.onap.appc.adapter.saltstack.Id");
606         assertEquals(TestId, "test1");
607     }
608
609     @Test
610     public void reqExecLog_shouldSetMessage() throws IllegalStateException, IllegalArgumentException {
611
612         params.put("Id", "101");
613
614         try {
615             adapter.reqExecLog(params, svcContext);
616             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.log");
617             //assertEquals(message, status);
618             assertEquals(null, status);
619         } catch (SvcLogicException e) {
620             String status = svcContext.getAttribute("org.onap.appc.adapter.saltstack.log");
621             fail(e.getMessage() + " Code = " + status);
622         } catch (Exception e) {
623             fail(e.getMessage() + " Unknown exception encountered ");
624         }
625     }
626 }