summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
32d7f42)
Change-Id: I887014d126485201f526d1e7ff03cc2e82e097b9
Signed-off-by: is005q <idan.shalom@intl.att.com>
12 files changed:
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
+Verify E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
+
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
+Verify E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
+
Restart simulator
Restart simulator
Restart simulator
Restart simulator
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
+Verify E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
+
+
Execute Shutdown
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Execute Shutdown
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
- Verify shutdown for gnb
\ No newline at end of file
+ Verify shutdown for gnb
+
+Verify E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Verify shutdown for enb
+Verify E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
+
+
Execute second Shutdown
Execute Shutdown
Verify again nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
Execute second Shutdown
Execute Shutdown
Verify again nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
- Verify shutdown for enb
\ No newline at end of file
+ Verify shutdown for enb
+
+Verify again E2T instance has no associated RANs
+ Verify E2T instance has no associated RANs
String response body ranName test1
String response body connectionStatus SHUT_DOWN
Missing response body associatedE2tInstanceAddress
String response body ranName test1
String response body connectionStatus SHUT_DOWN
Missing response body associatedE2tInstanceAddress
- ${result} e2mdbscripts.verify_ran_is_associated_with_e2t_instance test1 e2t.att.com:38000
- Should Be True ${result} == False
String response body ranName test2
String response body connectionStatus SHUT_DOWN
Missing response body associatedE2tInstanceAddress
String response body ranName test2
String response body connectionStatus SHUT_DOWN
Missing response body associatedE2tInstanceAddress
- ${result} e2mdbscripts.verify_ran_is_associated_with_e2t_instance test2 e2t.att.com:38000
- Should Be True ${result} == False
+
+Verify E2T instance has no associated RANs
+ ${result} e2mdbscripts.verify_e2t_instance_has_no_associated_rans e2t.att.com:38000
+ Should Be True ${result}
Execute Shutdown
PUT /v1/nodeb/shutdown
Execute Shutdown
PUT /v1/nodeb/shutdown
assocRanList = e2tInstanceDic.get("associatedRanList")
return ranName in assocRanList
assocRanList = e2tInstanceDic.get("associatedRanList")
return ranName in assocRanList
+def verify_e2t_instance_has_no_associated_rans(e2tAddress):
+ r = getRedisClientDecodeResponse()
+ e2tInstanceJson = r.get("{e2Manager},E2TInstance:"+e2tAddress)
+ e2tInstanceDic = json.loads(e2tInstanceJson)
+ assocRanList = e2tInstanceDic.get("associatedRanList")
+ return not assocRanList
+
+
def populate_e2t_instances_in_e2m_db_for_get_e2t_instances_tc():
r = getRedisClientDecodeResponse()
r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\",\"e2t.att.com:38001\"]")
def populate_e2t_instances_in_e2m_db_for_get_e2t_instances_tc():
r = getRedisClientDecodeResponse()
r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\",\"e2t.att.com:38001\"]")
assert.Equal(t, "info", config.Logging.LogLevel)
assert.Equal(t, 100, config.NotificationResponseBuffer)
assert.Equal(t, 5, config.BigRedButtonTimeoutSec)
assert.Equal(t, "info", config.Logging.LogLevel)
assert.Equal(t, 100, config.NotificationResponseBuffer)
assert.Equal(t, 5, config.BigRedButtonTimeoutSec)
- assert.Equal(t, 1500, config.KeepAliveResponseTimeoutMs)
- assert.Equal(t, 500, config.KeepAliveDelayMs)
+ assert.Equal(t, 4500, config.KeepAliveResponseTimeoutMs)
+ assert.Equal(t, 1500, config.KeepAliveDelayMs)
}
func TestParseConfigurationFileNotFoundFailure(t *testing.T) {
}
func TestParseConfigurationFileNotFoundFailure(t *testing.T) {
"e2mgr/rmrCgo"
"e2mgr/services"
"e2mgr/services/rmrsender"
"e2mgr/rmrCgo"
"e2mgr/services"
"e2mgr/services/rmrsender"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"time"
)
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"time"
)
rmClient clients.IRoutingManagerClient
}
rmClient clients.IRoutingManagerClient
}
+const PartialSuccessDueToRmErrorMessage = "Operation succeeded except for routing manager outbound call"
+
func NewDeleteAllRequestHandler(logger *logger.Logger, rmrSender *rmrsender.RmrSender, config *configuration.Configuration, rnibDataService services.RNibDataService, e2tInstancesManager managers.IE2TInstancesManager, rmClient clients.IRoutingManagerClient) *DeleteAllRequestHandler {
return &DeleteAllRequestHandler{
logger: logger,
func NewDeleteAllRequestHandler(logger *logger.Logger, rmrSender *rmrsender.RmrSender, config *configuration.Configuration, rnibDataService services.RNibDataService, e2tInstancesManager managers.IE2TInstancesManager, rmClient clients.IRoutingManagerClient) *DeleteAllRequestHandler {
return &DeleteAllRequestHandler{
logger: logger,
}
func (h *DeleteAllRequestHandler) Handle(request models.Request) (models.IResponse, error) {
}
func (h *DeleteAllRequestHandler) Handle(request models.Request) (models.IResponse, error) {
+ h.logger.Infof("#DeleteAllRequestHandler.Handle - handling shutdown request")
e2tAddresses, err := h.e2tInstancesManager.GetE2TAddresses()
e2tAddresses, err := h.e2tInstancesManager.GetE2TAddresses()
h.logger.Warnf("#DeleteAllRequestHandler.Handle - routing manager failure. continue flow.")
}
h.logger.Warnf("#DeleteAllRequestHandler.Handle - routing manager failure. continue flow.")
}
- err, allRansAreShutDown := h.updateNodebs(h.updateNodebInfoShuttingDown)
+ err, updatedAtLeastOnce := h.updateNodebs(h.updateNodebInfoShuttingDown)
if err != nil {
return nil, err
if err != nil {
return nil, err
return nil, e2managererrors.NewRmrError()
}
return nil, e2managererrors.NewRmrError()
}
- if allRansAreShutDown {
+ if !updatedAtLeastOnce {
+ h.logger.Infof("#DeleteAllRequestHandler.Handle - DB wasn't updated, not activating timer")
- return models.NewRedButtonPartialSuccessResponseModel("Operation succeeded, except Routing Manager failure"), nil
+ return models.NewRedButtonPartialSuccessResponseModel(PartialSuccessDueToRmErrorMessage), nil
- return models.NewRedButtonPartialSuccessResponseModel("Operation succeeded, except Routing Manager failure"), nil
+ return models.NewRedButtonPartialSuccessResponseModel(PartialSuccessDueToRmErrorMessage), nil
-func (h *DeleteAllRequestHandler) updateNodebs(updateCb func(node *entities.NodebInfo) error) (error, bool) {
+func (h *DeleteAllRequestHandler) updateNodebs(updateCb func(node *entities.NodebInfo) (error, bool)) (error, bool) {
nbIdentityList, err := h.rnibDataService.GetListNodebIds()
if err != nil {
nbIdentityList, err := h.rnibDataService.GetListNodebIds()
if err != nil {
return e2managererrors.NewRnibDbError(), false
}
return e2managererrors.NewRnibDbError(), false
}
- allRansAreShutdown := true
+ updatedAtLeastOnce := false
for _, nbIdentity := range nbIdentityList {
node, err := h.rnibDataService.GetNodeb(nbIdentity.InventoryName)
if err != nil {
for _, nbIdentity := range nbIdentityList {
node, err := h.rnibDataService.GetNodeb(nbIdentity.InventoryName)
if err != nil {
- h.logger.Errorf("#DeleteAllRequestHandler.updateNodebs - failed to get nodeB entity for ran name: %s from rNib. error: %s", nbIdentity.InventoryName, err)
- return e2managererrors.NewRnibDbError(), false
- }
+ _, ok := err.(*common.ResourceNotFoundError)
- if node.ConnectionStatus != entities.ConnectionStatus_SHUT_DOWN {
- allRansAreShutdown = false
+ if !ok {
+ h.logger.Errorf("#DeleteAllRequestHandler.updateNodebs - failed to get nodeB entity for ran name: %s from rNib. error: %s", nbIdentity.InventoryName, err)
+ return e2managererrors.NewRnibDbError(), false
+ }
+ continue
+ err, updated := updateCb(node)
if err != nil {
return err, false
}
if err != nil {
return err, false
}
- return nil, allRansAreShutdown
+ if updated {
+ updatedAtLeastOnce = true
+ }
+ }
+ return nil, updatedAtLeastOnce
-func (h *DeleteAllRequestHandler) updateNodebInfoForceShutdown(node *entities.NodebInfo) error {
- return h.updateNodebInfo(node, entities.ConnectionStatus_SHUT_DOWN, true)
+func (h *DeleteAllRequestHandler) updateNodebInfoForceShutdown(node *entities.NodebInfo) (error, bool) {
+ err := h.updateNodebInfo(node, entities.ConnectionStatus_SHUT_DOWN, true)
+
+ if err != nil {
+ return err, false
+ }
+
+ return nil, true
-func (h *DeleteAllRequestHandler) updateNodebInfoShuttingDown(node *entities.NodebInfo) error {
+func (h *DeleteAllRequestHandler) updateNodebInfoShuttingDown(node *entities.NodebInfo) (error, bool) {
if node.ConnectionStatus == entities.ConnectionStatus_SHUT_DOWN {
if node.ConnectionStatus == entities.ConnectionStatus_SHUT_DOWN {
- return h.updateNodebInfo(node, entities.ConnectionStatus_SHUTTING_DOWN, true)
+ err := h.updateNodebInfo(node, entities.ConnectionStatus_SHUTTING_DOWN, true)
+
+ if err != nil {
+ return err, false
+ }
+
+ return nil, true
-func (h *DeleteAllRequestHandler) updateNodebInfoShutDown(node *entities.NodebInfo) error {
+func (h *DeleteAllRequestHandler) updateNodebInfoShutDown(node *entities.NodebInfo) (error, bool) {
if node.ConnectionStatus == entities.ConnectionStatus_SHUT_DOWN {
if node.ConnectionStatus == entities.ConnectionStatus_SHUT_DOWN {
}
if node.ConnectionStatus != entities.ConnectionStatus_SHUTTING_DOWN {
h.logger.Warnf("#DeleteAllRequestHandler.updateNodebInfoShutDown - RAN name: %s - ignore, status is not Shutting Down", node.RanName)
}
if node.ConnectionStatus != entities.ConnectionStatus_SHUTTING_DOWN {
h.logger.Warnf("#DeleteAllRequestHandler.updateNodebInfoShutDown - RAN name: %s - ignore, status is not Shutting Down", node.RanName)
+ return nil, false
+ }
+
+ err := h.updateNodebInfo(node, entities.ConnectionStatus_SHUT_DOWN, false)
+
+ if err != nil {
+ return err, false
- return h.updateNodebInfo(node, entities.ConnectionStatus_SHUT_DOWN, false)
}
func (h *DeleteAllRequestHandler) updateNodebInfo(node *entities.NodebInfo, connectionStatus entities.ConnectionStatus, resetAssociatedE2TAddress bool) error {
}
func (h *DeleteAllRequestHandler) updateNodebInfo(node *entities.NodebInfo, connectionStatus entities.ConnectionStatus, resetAssociatedE2TAddress bool) error {
}
func (m *E2TInstancesManager) ClearRansOfAllE2TInstances() error {
}
func (m *E2TInstancesManager) ClearRansOfAllE2TInstances() error {
+ m.logger.Infof("#E2TInstancesManager.ClearRansOfAllE2TInstances - Going to clear associated RANs from E2T instances")
m.mux.Lock()
defer m.mux.Unlock()
m.mux.Lock()
defer m.mux.Unlock()
maxConnectionAttempts: 3
maxRnibConnectionAttempts: 3
rnibRetryIntervalMs: 10
maxConnectionAttempts: 3
maxRnibConnectionAttempts: 3
rnibRetryIntervalMs: 10
-keepAliveResponseTimeoutMs: 1500
-keepAliveDelayMs: 500
+keepAliveResponseTimeoutMs: 4500
+keepAliveDelayMs: 1500
}
func (w *rNibDataService) GetNodeb(ranName string) (*entities.NodebInfo, error) {
}
func (w *rNibDataService) GetNodeb(ranName string) (*entities.NodebInfo, error) {
- w.logger.Infof("#RnibDataService.GetNodeb - RAN name: %s", ranName)
var nodeb *entities.NodebInfo = nil
var nodeb *entities.NodebInfo = nil
+ if err == nil {
+ w.logger.Infof("#RnibDataService.GetNodeb - RAN name: %s, connection status: %s", nodeb.RanName, nodeb.ConnectionStatus)
+ }
+
return nodeb, err
}
func (w *rNibDataService) GetListNodebIds() ([]*entities.NbIdentity, error) {
return nodeb, err
}
func (w *rNibDataService) GetListNodebIds() ([]*entities.NbIdentity, error) {
- w.logger.Infof("#RnibDataService.GetListNodebIds")
-
var nodeIds []*entities.NbIdentity = nil
err := w.retry("GetListNodebIds", func() (err error) {
var nodeIds []*entities.NbIdentity = nil
err := w.retry("GetListNodebIds", func() (err error) {
+ if err == nil {
+ w.logger.Infof("#RnibDataService.GetListNodebIds - RANs count: %d", len(nodeIds))
+ }
+