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

[test] Lua tests for netjson monitoring #26

Merged
merged 23 commits into from
Jul 20, 2021

Conversation

devkapilbansal
Copy link
Member

@devkapilbansal devkapilbansal commented May 4, 2021

Closes #7

@devkapilbansal devkapilbansal force-pushed the lua-tests branch 2 times, most recently from ea55285 to c157468 Compare May 4, 2021 23:08
@devkapilbansal devkapilbansal marked this pull request as ready for review May 4, 2021 23:10
@devkapilbansal devkapilbansal changed the title [test] Lua tests of netjson monitoring [test] Lua tests for netjson monitoring May 7, 2021
@devkapilbansal devkapilbansal force-pushed the lua-tests branch 3 times, most recently from f1de4ff to e669d40 Compare May 9, 2021 14:19
@devkapilbansal
Copy link
Member Author

I split netjson_monitoring.lua across multiple files for now. Will add tests for those files and then for netjson_monitoring at end.
Will restructure files and tests at end.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's some suggestions

miscellaneous_functions.lua Outdated Show resolved Hide resolved
miscellaneous_functions.lua Outdated Show resolved Hide resolved
interface_functions.lua Outdated Show resolved Hide resolved
tests/test_interface.lua Outdated Show resolved Hide resolved
miscellaneous_functions.lua Outdated Show resolved Hide resolved
interface_functions.lua Outdated Show resolved Hide resolved
tests/test_utils.lua Outdated Show resolved Hide resolved
miscellaneous_functions.lua Outdated Show resolved Hide resolved
dhcp.lua Outdated Show resolved Hide resolved
@devkapilbansal devkapilbansal force-pushed the lua-tests branch 3 times, most recently from 5ac238f to 395c251 Compare May 11, 2021 21:50
@devkapilbansal devkapilbansal force-pushed the lua-tests branch 3 times, most recently from d82df2d to d970635 Compare May 21, 2021 17:14
@devkapilbansal devkapilbansal changed the base branch from master to gsoc21 June 9, 2021 11:21
@devkapilbansal devkapilbansal force-pushed the lua-tests branch 6 times, most recently from c5cd17e to d34b474 Compare June 17, 2021 12:44
@devkapilbansal devkapilbansal changed the base branch from gsoc21 to issues/28-qa-check June 17, 2021 12:45
@devkapilbansal
Copy link
Member Author

Updating the base branch from gsoc21 to issues/28-qa-check for now. Will change it once #30 is merged

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubus call iwinfo associlist '{"device": "<interface_name>"}, for a mesh interface:

{
  "results": [
    {
      "mac": "00:00:00:00:00:00",
      "signal": -76,
      "signal_avg": -76,
      "noise": -87,
      "inactive": 0,
      "connected_time": 314439,
      "thr": 148687,
      "authorized": true,
      "authenticated": true,
      "preamble": "long",
      "wme": true,
      "mfp": true,
      "tdls": false,
      "mesh llid": 0,
      "mesh plid": 0,
      "mesh plink": "ESTAB",
      "mesh local PS": "ACTIVE",
      "mesh peer PS": "ACTIVE",
      "mesh non-peer PS": "ACTIVE",
      "rx": {
        "drop_misc": 610279,
        "packets": 40424675,
        "bytes": 280218466,
        "ht": false,
        "vht": true,
        "mhz": 80,
        "rate": 195000,
        "mcs": 1,
        "nss": 3,
        "short_gi": true
      },
      "tx": {
        "failed": 2377,
        "retries": 11358818,
        "packets": 50325775,
        "bytes": 124429140,
        "ht": false,
        "vht": true,
        "mhz": 80,
        "rate": 195000,
        "mcs": 1,
        "nss": 3,
        "short_gi": true
      }
    }
  ]
}
{
  "results": [
    {
      "mac": "00:00:00:00:00:00",
      "signal": -67,
      "signal_avg": -65,
      "noise": 0,
      "inactive": 6996,
      "connected_time": 314507,
      "thr": 4500,
      "authorized": true,
      "authenticated": true,
      "preamble": "long",
      "wme": true,
      "mfp": true,
      "tdls": false,
      "mesh llid": 0,
      "mesh plid": 0,
      "mesh plink": "ESTAB",
      "mesh local PS": "ACTIVE",
      "mesh peer PS": "ACTIVE",
      "mesh non-peer PS": "ACTIVE",
      "rx": {
        "drop_misc": 585666,
        "packets": 5533127,
        "bytes": 445412093,
        "ht": true,
        "vht": false,
        "mhz": 20,
        "rate": 6500,
        "mcs": 0,
        "40mhz": false,
        "short_gi": false
      },
      "tx": {
        "failed": 0,
        "retries": 5,
        "packets": 12,
        "bytes": 1173,
        "ht": true,
        "vht": false,
        "mhz": 20,
        "rate": 6500,
        "mcs": 0,
        "40mhz": false,
        "short_gi": false
      }
    }
  ]
}

@devkapilbansal devkapilbansal force-pushed the lua-tests branch 3 times, most recently from 8e003a7 to 70d360d Compare July 11, 2021 22:08
install-dev.sh Show resolved Hide resolved
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devkapilbansal some minor concerns below.

Also, please add the coveralls badge in the README.

openwrt-openwisp-monitoring/files/lib/openwisp/wifi.lua Outdated Show resolved Hide resolved
openwrt-openwisp-monitoring/files/lib/openwisp/wifi.lua Outdated Show resolved Hide resolved
openwrt-openwisp-monitoring/tests/basic_env.lua Outdated Show resolved Hide resolved
openwrt-openwisp-monitoring/tests/basic_env.lua Outdated Show resolved Hide resolved
openwrt-openwisp-monitoring/tests/main_env.lua Outdated Show resolved Hide resolved
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the docs and ran the tests, found the minor issues below.

README.rst Show resolved Hide resolved
README.rst Show resolved Hide resolved
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still can't get the deamon to work and I do not know what is going on.

Fri Jul 16 10:05:46 2021 daemon.info monitoring: OpenWISP monitoring daemon started
Fri Jul 16 10:06:12 2021 daemon.info procd: Instance openwisp_monitoring::openwisp_monitoring_monitoring s in a crash loop 6 crashes, 0 seconds since last crash

@devkapilbansal are you testing the build produced by this thing on OpenWRT?

@devkapilbansal
Copy link
Member Author

I still can't get the deamon to work and I do not know what is going on.

Fri Jul 16 10:05:46 2021 daemon.info monitoring: OpenWISP monitoring daemon started
Fri Jul 16 10:06:12 2021 daemon.info procd: Instance openwisp_monitoring::openwisp_monitoring_monitoring s in a crash loop 6 crashes, 0 seconds since last crash

@devkapilbansal are you testing the build produced by this thing on OpenWRT?

Hi, I fixed this errors in #42
I think this should be tested after it is merged.

@nemesifier
Copy link
Member

I still can't get the deamon to work and I do not know what is going on.

Fri Jul 16 10:05:46 2021 daemon.info monitoring: OpenWISP monitoring daemon started
Fri Jul 16 10:06:12 2021 daemon.info procd: Instance openwisp_monitoring::openwisp_monitoring_monitoring s in a crash loop 6 crashes, 0 seconds since last crash

@devkapilbansal are you testing the build produced by this thing on OpenWRT?

Hi, I fixed this errors in #42
I think this should be tested after it is merged.

@devkapilbansal ok, please fix the minor issues pointed out at the docs so I can merge this.

@devkapilbansal
Copy link
Member Author

Hi @nemesisdesign,
I updated the documentation and remove the noise from the tests.

README.rst Outdated Show resolved Hide resolved
@nemesifier nemesifier merged commit 91f319a into openwisp:gsoc21 Jul 20, 2021
@devkapilbansal devkapilbansal deleted the lua-tests branch July 20, 2021 19:05
@nemesifier nemesifier mentioned this pull request Jul 25, 2021
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

Successfully merging this pull request may close these issues.

Write lua tests
3 participants