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

interface counter is not working on gscli #81

Open
r-suke opened this issue Nov 6, 2023 · 5 comments
Open

interface counter is not working on gscli #81

r-suke opened this issue Nov 6, 2023 · 5 comments

Comments

@r-suke
Copy link
Contributor

r-suke commented Nov 6, 2023

Now I'm testing GFT and I found interface counter is not working on gscli.

# gscli
> interface Interface1/0/1
interface(Interface1/0/1)> show counters
Traceback (most recent call last):
  File "/usr/local/bin/gscli", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/main.py", line 198, in main
    asyncio.run(_main())
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/main.py", line 194, in _main
    await asyncio.gather(*tasks)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/main.py", line 107, in loop_async
    await shell.exec(line)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/main.py", line 56, in exec
    ret = self.context.exec(cmd, no_fail=no_fail)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/base.py", line 410, in exec
    return self._command(line, self.fuzzy_completion)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/base.py", line 284, in __call__
    return cmd(line[1:], fuzzy)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/base.py", line 284, in __call__
    return cmd(line[1:], fuzzy)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/base.py", line 273, in __call__
    return self.exec(line)
  File "/usr/local/lib/python3.10/site-packages/goldstone/north/cli/interface.py", line 1090, in exec
    show_counters(self.conn, ifnames, table)
TypeError: show_counters() missing 1 required positional argument: 'model'

and I changed /usr/local/lib/python3.10/site-packages/goldstone/north/cli/interface.py

# diff interface.py interface.py_
1050,1051d1049
<         self.model = options.get("model", "goldstone-interfaces")
<
1091d1088
<             model   = self.model
1093c1090
<         show_counters(self.conn, ifnames, table, model)
---
>         show_counters(self.conn, ifnames, table)
interface(Interface1/0/1)> show counters
  in-octets: 36338662426254
  in-unicast-pkts: 53171120684
  in-broadcast-pkts: 0
  in-multicast-pkts: 0
  in-errors: 0
  out-octets: 135778516800
  out-unicast-pkts: 0
  out-broadcast-pkts: 0
  out-multicast-pkts: 2121539325
  out-discards: 324009
  out-errors: 0

it looks work (I don't know well it is correct or not) .
I could not find interface.py code (Is it packaged some where?) and could not make pull request.
First, I'd like to report that there is a syntax error in the interface.py and that it's not working clearly.

@ishidawataru ishidawataru transferred this issue from oopt-goldstone/goldstone-buildimage Nov 6, 2023
@ishidawataru
Copy link
Contributor

@r-suke Thanks for the report. This is related to the management framework. I transferred the issue to the mgmt repo. You can find interface.py here

@ishidawataru
Copy link
Contributor

@r-suke This is a bug introduced by this commit. Your fix seems good to me. Could you open a PR? I'd appreciate it if you could add a test here.

@r-suke
Copy link
Contributor Author

r-suke commented Nov 6, 2023

I'd appreciate it if you could add a test here.

Sorry, now we have no CI environment for goldstone. Now I'm changing code directly on GFT. Maybe It takes time to prepare it (and I have to understand how the test code works).

@ishidawataru
Copy link
Contributor

Sure, no problem. Basically, you only need Docker for the CI environment.

$ make tester # build the tester image
$ docker run -t -v `pwd`:`pwd` -w `pwd` ghcr.io/oopt-goldstone/mgmt/tester make unittest

This will run the unittest.

@r-suke
Copy link
Contributor Author

r-suke commented Nov 6, 2023

Thank you for telling. I'll prepare it.

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

No branches or pull requests

2 participants