Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With MockDriver, Server-side-test and PR-Integration-test can be convenient. #292

Closed
powerkimhub opened this issue Sep 5, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@powerkimhub
Copy link
Member

powerkimhub commented Sep 5, 2020

[AS-IS]

  • Server-side 동작 Test 시에도 무조건 CSP Credential 및 Resource(VPC, VM 등) 필요 => 시험 비용/시간 증가
  • PR-통합 시험시 모든 PR(Pull Requests) 통합 시험마다 CSP 연동 시험 => 시험 비용/시간 증가
  • Cloud-Twin이 대안이 될수 있으나, Cloud-Twin 경우 Kubernetes 환경 필요

[TO-BE]

  • MockDriver 추가 => CSP 연동 없이 Server-Side 동작 시험 가능 => 시험 비용/시간 감소
  • 단, Test Layer는
    • User -> before Cloud Driver
    • CSP 연동 시험은 기존 시험 등 별도 시험 방법 활용
@powerkimhub powerkimhub added the enhancement New feature or request label Sep 5, 2020
@powerkimhub powerkimhub self-assigned this Sep 5, 2020
@powerkimhub
Copy link
Member Author

powerkimhub commented Sep 5, 2020

[Todo]

  1. MockDriver 개발
  1. Server 반영 위치
  • ./conf/cloudos.yaml
  • ./cloud-control-manager/CloudDriverHandler.go
  1. 시험 도구 반영
  • ./cb-spider/api-runtime/rest-runtime/test/each-test/*
  1. AdminWeb 반영 위치
  • ./api-runtime/rest-runtime/admin-web/AdminWeb-CIM.go
  • ./api-runtime/rest-runtime/admin-web/AdminWeb-CCM.go

@powerkimhub powerkimhub changed the title With MockCloudDriver, Server-side-test and PR-Integration-test can be convenient. With MockDriver, Server-side-test and PR-Integration-test can be convenient. Sep 5, 2020
@powerkimhub
Copy link
Member Author

powerkimhub commented Sep 5, 2020

개략 설계

[MockDriver 연결 설정 개요]

  • Credential에 MockName 제공
  • MockName을 다르게 설정하면, 자원 생성/삭제 관리 독립 운영
    => Server-side 동시 시험 활용 가능
  • 연결 설정 예시
 # 1. Mock 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"}'

 # 2. Cloud Credential Info
curl -X POST http://$RESTSERVER:1024/spider/credential -H 'Content-Type: application/json' -d '{"CredentialName":"mock-credential01","ProviderName":"MOCK", "KeyValueInfoList": [{"Key":"MockName", "Value":"mock01"}]}'

 # 3. Cloud Region Info
curl -X POST http://$RESTSERVER:1024/spider/region -H 'Content-Type: application/json' -d '{"RegionName":"docker-region01","ProviderName":"MOCK", "KeyValueInfoList": [{"Key":"Region", "Value":"default"}]}'

 # 4. 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"}'

[MockDriver 내부 처리 개요]

  • VPC 등 자원 생성 API 호출 => 메모리에 VPC Info 정보 추가
  • VPC 등 자원 목록 API 호출 => 메모리의 VPC Info 목록 제공
  • VPC 등 자원 삭제 API 호출 => 메모리에 VPC Info 정보 삭제

[MockDriver 내부 정보 관리 구조]

  • MockDriver는 시험용, 시험이 완료되거나 재시작되면 저장 데이터는 사라져도 무관 => 메모리에 관리
  • MockName 별로 자원 Info 객체 list를 Map 구조로 관리(Global Variable)
    • Map 개략 구조: Key=MockName, Value=Array of ResourceInfo
    • Go ex) var imgInfoMap map[string][]irs.ImageInfo

@powerkimhub
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant