aboutsummaryrefslogtreecommitdiffstats
path: root/src/dcm/pkg/module/logicalcloud_test.go
AgeCommit message (Collapse)AuthorFilesLines
2020-10-10Restore commented unit test TestDeleteLogicalCloudIgor D.C1-9/+24
Restore the previously commented-out unit test TestDeleteLogicalCloud. That test was disabled due to a failure introduced by interacting with AppContext for the first time in module/logicalcloud.go and it not being ready to do so. This commit restores it and modifies code so dependent mocks can plug in correctly. This was done in order to keep testing the code that was previously being tested, not so much to add additional coverage. Although it would be a significant undertaking, the different types and interfaces in pkg/module should be redesigned to achieve better decoupling and thus make unit testing more straightforward. Issue-ID: MULTICLOUD-1143 Change-Id: I1e6b7bb9111fc6883f0c9cee887329a9e0b27fbd Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
2020-10-02Reimplement Terminate to be compatible with StatusIgor D.C1-6/+9
This also includes modifying Apply and Delete, since there are strict conditions that need to be met in each, to prevent Logical Clouds (LCs) from entering a bad state. Summary of what's being done here: - When applying: - set tag 'lccontext' in the LC to the context ID (was already done) - and let rsync know about the appcontext (grpc) (was already done) - if tag was already set, check current context /status - if context /status is actually Terminated, 'lccontext' is set to new context ID and previous AppContext deleted - When terminating: - lets rsync know about the termination request (grpc) - When deleting: - checks whether the current context /status is Terminated - if it is, then it will remove the latest LC context This particular commit disables the TestDeleteLogicalCloud test until a known issue behind the test is resolved. This commit does not leverage the full capacity of the Status framework, but is sufficient to support all operations. A future patch will entirely migrate DCM to the Status framework. Until then, a known issue exists where DCM will forget about context IDs previously associated to a particular Logical Cloud (only keeps last). Issue-ID: MULTICLOUD-1143 Change-Id: I7a6034eba543c2a27daa41b7fe6298cb2a85f9ce Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
2020-09-26Add a couple of sanity checks in DCMIgor D.C1-0/+8
When applying, check whether logical cloud is already applied. When deleting logical cloud, check if it exists. Issue-ID: MULTICLOUD-1143 Change-Id: I6aa11d8921db76e3d9e9632f915b55fe7ab8efab Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
2020-09-25Implement Terminate operation in DCMIgor D.C1-4/+4
Also makes minor changes to non-terminate code as a side-effect of supporting the new Terminate operation (such as including tagContext in the LogicalCloudClient implementation of LogicalCloudManager interface). These changes are/will also be leveraged by other operations. Issue-ID: MULTICLOUD-1143 Change-Id: Idbd2ec9f6cf0e5584a0f51cf4c16144db56d9fa0 Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
2020-08-05DCM - fix code formatting via vscode (II)Igor D.C1-157/+156
Part two of fixing code format/syntax with Visual Studio Code. Furthermore, also switched line endings from CRLF to LF (all test files seemed to be ending this way, unlike the other Go files). Issue-ID: MULTICLOUD-1143 Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com> Change-Id: Iaae868c780a42ea82ca1208e3cbdc3ec6ffd1f97
2020-04-10Add Distributed Cloud Managerenyinna12341-0/+157
This handles RESTful API CRUD operations for logical clouds, CLuster, User Permissions, Quota, and Key Value pairs. See: https://wiki.onap.org/x/tAiVB Issue-ID: MULTICLOUD-996 Signed-off-by: Enyinna Ochulor <enyinna.ochulor@intel.com> Change-Id: I654a304cd682f762c02cfd92b4483d1edea63fca