@@ -47,7 +47,6 @@ restore_config() {
47
47
echo -e " \n${YELLOW} Restoring backed up configuration values...${NC} "
48
48
eval " ${COMMAND_PREFIX} config set defaultOrg ${DEFORG_BAK} "
49
49
eval " ${COMMAND_PREFIX} config set apiToken ${TOKEN_BAK} "
50
- eval " ${COMMAND_PREFIX} config set isTestingV1 ${TESTV1_BAK} "
51
50
echo -e " ${GREEN} Configuration restored!${NC} "
52
51
}
53
52
259
258
echo " Backing up default org and apitoken..."
260
259
DEFORG_BAK=$( eval " $COMMAND_PREFIX config get defaultOrg --json" | jq -r ' .data' )
261
260
TOKEN_BAK=$( eval " $COMMAND_PREFIX config get apiToken --json" | jq -r ' .data' )
262
- TESTV1_BAK=$( eval " $COMMAND_PREFIX config get isTestingV1 --json" | jq -r ' .data' )
263
261
echo " Backing complete!"
264
262
265
263
# Set up trap to restore config on any exit
266
264
trap restore_config EXIT
267
265
268
- # This smoke test assumes the <v1 cli api
269
- run_socket 0 config set isTestingV1 true
270
-
271
266
# ## Analytics
272
267
273
268
if should_run_section " analytics" ; then
343
338
# ## dependencies
344
339
345
340
if should_run_section " dependencies" ; then
346
- run_socket 0 dependencies
347
- run_socket 0 dependencies --help
348
- run_socket 0 dependencies --dry-run
349
- run_json 0 dependencies --json
350
- run_socket 0 dependencies --markdown
351
-
352
- run_socket 0 dependencies --limit 1
353
- run_socket 0 dependencies --offset 5
354
- run_socket 0 dependencies --limit 1 --offset 10
355
-
356
- # run_json 2 dependencies --json --wat foo
357
- run_json 0 dependencies --json --limit -200
358
- run_json 0 dependencies --json --limit NaN
359
- run_json 0 dependencies --json --limit foo
341
+ run_socket 0 organization dependencies
342
+ run_socket 0 organization dependencies --help
343
+ run_socket 0 organization dependencies --dry-run
344
+ run_json 0 organization dependencies --json
345
+ run_socket 0 organization dependencies --markdown
346
+
347
+ run_socket 0 organization dependencies --limit 1
348
+ run_socket 0 organization dependencies --offset 5
349
+ run_socket 0 organization dependencies --limit 1 --offset 10
350
+
351
+ # run_json 2 organization dependencies --json --wat foo
352
+ run_json 0 organization dependencies --json --limit -200
353
+ run_json 0 organization dependencies --json --limit NaN
354
+ run_json 0 organization dependencies --json --limit foo
360
355
fi
361
356
362
357
# ## fix
@@ -404,27 +399,27 @@ if should_run_section "manifest"; then
404
399
run_socket 2 manifest
405
400
run_socket 0 manifest --help
406
401
run_socket 0 manifest --dry-run
407
- run_socket 2 manifest auto
402
+ run_socket 1 manifest auto
408
403
run_socket 0 manifest auto --help
409
404
run_socket 0 manifest auto --dry-run
410
- run_socket 2 manifest conda
405
+ run_socket 1 manifest conda
411
406
run_socket 0 manifest conda --help
412
- run_socket 2 manifest conda --dry-run
413
- run_socket 2 manifest gradle
407
+ run_socket 0 manifest conda --dry-run
408
+ run_socket 1 manifest gradle
414
409
run_socket 0 manifest gradle --help
415
- run_socket 2 manifest gradle --dry-run
416
- run_socket 2 manifest kotlin
410
+ run_socket 1 manifest gradle --dry-run
411
+ run_socket 1 manifest kotlin
417
412
run_socket 0 manifest kotlin --help
418
- run_socket 2 manifest kotlin --dry-run
419
- run_socket 2 manifest scala
413
+ run_socket 0 manifest kotlin --dry-run
414
+ run_socket 1 manifest scala
420
415
run_socket 0 manifest scala --help
421
- run_socket 2 manifest scala --dry-run
416
+ run_socket 0 manifest scala --dry-run
422
417
fi
423
418
424
419
# ## npm
425
420
426
421
if should_run_section " npm" ; then
427
- run_socket 1 npm
422
+ run_socket 0 npm info
428
423
run_socket 0 npm --help
429
424
run_socket 0 npm --dry-run
430
425
run_socket 0 npm info
433
428
# ## npx
434
429
435
430
if should_run_section " npx" ; then
436
- run_socket 2 npx
431
+ run_socket 0 npx cowsay moo
437
432
run_socket 0 npx --help
438
433
run_socket 0 npx --dry-run
439
434
run_socket 0 npx socket --dry-run
452
447
453
448
if should_run_section " optimize" ; then
454
449
run_socket 0 optimize
450
+ run_socket 0 optimize --prod
451
+ run_socket 0 optimize --pin
455
452
run_socket 0 optimize --help
456
453
run_socket 0 optimize --dry-run
457
454
fi
458
455
459
456
# ## organization
460
457
461
458
if should_run_section " organization" ; then
462
- run_socket 0 organization
459
+ run_socket 2 organization
463
460
run_socket 0 organization --help
464
461
run_socket 0 organization --dry-run
465
462
run_socket 0 organization list
@@ -495,9 +492,20 @@ if should_run_section "organization"; then
495
492
run_json 1 organization policy license --org trash --json
496
493
run_socket 0 organization policy license --org $DEFORG_BAK
497
494
495
+ echo " "
496
+ echo " "
497
+ echo " Clearing defaultOrg for next tests"
498
498
eval " $COMMAND_PREFIX config unset defaultOrg"
499
- run_json 2 organization policy security --json --no-interactive
500
- run_json 2 organization policy license --json --no-interactive
499
+ run_json 1 organization policy security --json --no-interactive
500
+ run_json 1 organization policy license --json --no-interactive
501
+ echo " "
502
+ echo " "
503
+ echo " Setting defaultOrg to an invalid org for the next tests"
504
+ eval " $COMMAND_PREFIX config set defaultOrg fake_org"
505
+ run_json 1 organization policy security --json --no-interactive
506
+ run_json 1 organization policy license --json --no-interactive
507
+ echo " "
508
+ echo " "
501
509
echo " Restoring default org to $DEFORG_BAK "
502
510
eval " ${COMMAND_PREFIX} config set defaultOrg $DEFORG_BAK "
503
511
fi
548
556
# ## raw-npx
549
557
550
558
if should_run_section " raw-npx" ; then
551
- run_socket 0 raw-npx # interactive shell...
559
+ run_socket 0 raw-npx cowsay moo
552
560
run_socket 0 raw-npx --help
553
561
run_socket 0 raw-npx --dry-run
554
562
run_socket 0 raw-npx socket --dry-run
@@ -577,18 +585,26 @@ if should_run_section "repos"; then
577
585
run_socket 2 repos del --dry-run
578
586
run_socket 0 repos del cli-smoke-test
579
587
588
+ echo " "
589
+ echo " "
590
+ echo " Clearing defaultOrg for next tests"
580
591
eval " $COMMAND_PREFIX config unset defaultOrg"
581
592
run_json 2 repos create ' cli_donotcreate' --json --no-interactive
582
593
run_json 2 repos del ' cli_donotcreate' --json --no-interactive
583
594
run_json 2 repos view ' cli_donotcreate' --json --no-interactive
584
595
run_json 2 repos list --json --no-interactive
585
596
run_json 2 repos update ' cli_donotcreate' --homepage evil --json --no-interactive
597
+ echo " "
598
+ echo " "
599
+ echo " Setting defaultOrg to an invalid org for the next tests"
586
600
eval " $COMMAND_PREFIX config set defaultOrg fake_org"
587
601
run_json 1 repos create ' cli_donotcreate' --json
588
602
run_json 1 repos del ' cli_donotcreate' --json
589
603
run_json 1 repos view ' cli_donotcreate' --json
590
604
run_json 1 repos list --json
591
605
run_json 1 repos update ' cli_donotcreate' --homepage evil --json
606
+ echo " "
607
+ echo " "
592
608
echo " Restoring default org to $DEFORG_BAK "
593
609
eval " ${COMMAND_PREFIX} config set defaultOrg $DEFORG_BAK "
594
610
run_json 1 repos view ' cli_donotcreate' --json
@@ -653,18 +669,27 @@ if should_run_section "scan"; then
653
669
run_json 1 scan metadata " $SBOM_ID " --org fake_org --json
654
670
run_socket 1 scan diff " $SBOM_ID " " $SBOM_ID " --org fake_org
655
671
run_json 1 scan diff " $SBOM_ID " " $SBOM_ID " --org fake_org --json
672
+
673
+ echo " "
674
+ echo " "
675
+ echo " Clearing defaultOrg for the next tests"
656
676
eval " $COMMAND_PREFIX config unset defaultOrg"
657
677
run_json 2 scan create . --json --no-interactive
658
678
run_json 2 scan view " $SBOM_ID " --json --no-interactive
659
679
run_json 2 scan report " $SBOM_ID " --json --no-interactive
660
680
run_json 2 scan metadata " $SBOM_ID " --json --no-interactive
661
681
run_json 2 scan diff " $SBOM_ID " " $SBOM_ID " --json --no-interactive
682
+ echo " "
683
+ echo " "
684
+ echo " Setting defaultOrg to an invalid org for the next tests"
662
685
eval " $COMMAND_PREFIX config set defaultOrg fake_org"
663
686
run_json 1 scan create . --json
664
687
run_json 1 scan view " $SBOM_ID " --json
665
688
run_json 1 scan report " $SBOM_ID " --json
666
689
run_json 1 scan metadata " $SBOM_ID " --json
667
690
run_json 1 scan diff " $SBOM_ID " " $SBOM_ID " --json
691
+ echo " "
692
+ echo " "
668
693
echo " Restoring default org to $DEFORG_BAK "
669
694
eval " ${COMMAND_PREFIX} config set defaultOrg $DEFORG_BAK "
670
695
fi
@@ -687,8 +712,8 @@ if should_run_section "wrapper"; then
687
712
run_socket 2 wrapper
688
713
run_socket 0 wrapper --help
689
714
run_socket 2 wrapper --dry-run
690
- run_socket 0 wrapper --enable
691
- run_socket 0 wrapper --disable
715
+ run_socket 0 wrapper on
716
+ run_socket 0 wrapper off
692
717
fi
693
718
694
719
# ## The end
0 commit comments