| # ----------------------------------------------------------------------------- |
| # Invokes the ONOS CLI and looks for a 'maps' entry with the given name |
| # ----------------------------------------------------------------------------- |
| print "usage: onos-find-and-check-map onos-node map-name should-be-zero" |
| shouldBeZero = sys.argv[3] |
| cli = subprocess.Popen(["onos", node, "maps", "-j"], stdout=subprocess.PIPE) |
| json = json.loads(cli.communicate()[0]) |
| foundMapName = map["name"] |
| foundMapSize = map["size"] |
| if foundMapName == mapName: |
| if (shouldBeZero == 'yes' and foundMapSize == 0) or \ |
| (shouldBeZero != 'yes' and foundMapSize != 0): |