How to test CB Spider with Mock Driver - cloud-barista/cb-spider GitHub Wiki

Overview

  • This CB-Spider supports new Mock Driver
    • for beginners to experience CB-Spider easily.
    • for CI Test driven by PR | MERGE of Github Contribution.
  • The Mock Driver emulates the operations of the CSP
  • Restarting the Spider server, Mock driver's resource data is cleaned.

Step 1. start server

Step 2. register connection info of Mock Driver

  • Terminal-2: run this scripts(or AdminWeb, Spider-CLI)

    $ $CBSPIDER_ROOT/api-runtime/rest-runtime/test/connect-config/9.mock-conn-config.sh
    
     $ cat $CBSPIDER_ROOT/api-runtime/rest-runtime/test/connect-config/9.mock-conn-config.sh
     RESTSERVER=localhost
    
      # for Cloud Driver Info
     curl -X POST http://$RESTSERVER:1024/spider/driver -H 'Content-Type: application/json' -d '{"DriverName":"mock-driver01","ProviderName":"MOCK", "DriverLibFileName":"mock-driver-v1.0.so"}'
    
      # for Cloud Credential Info
     # for Mock
     curl -X POST http://$RESTSERVER:1024/spider/credential -H 'Content-Type: application/json' -d '{"CredentialName":"mock-credential01","ProviderName":"MOCK", "KeyValueInfoList": [{"Key":"MockName", "Value":"mock_name00"}]}'
    
      # Cloud Region Info
     curl -X POST http://$RESTSERVER:1024/spider/region -H 'Content-Type: application/json' -d '{"RegionName":"mock-region01","ProviderName":"MOCK", "KeyValueInfoList": [{"Key":"Region", "Value":"default"}]}'
    
      # Cloud Connection Config Info
     curl -X POST http://$RESTSERVER:1024/spider/connectionconfig -H 'Content-Type: application/json' -d '{"ConfigName":"mock-config01","ProviderName":"MOCK", "DriverName":"mock-driver01", "CredentialName":"mock-credential01", "RegionName":"mock-region01"}'
    

Step 3. control of Mock Driver with GUI AdminWeb

⚠️ **GitHub.com Fallback** ⚠️