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

chore: removed active from models and included scripts/unset_active.py #146

Merged
merged 11 commits into from
Jun 22, 2023

Conversation

viniarck
Copy link
Member

@viniarck viniarck commented Jun 20, 2023

Closes #141

This PR is on top of PR #136 (since PR 136 is the next one to get merged)

Summary

  • Added scripts/unset_active.py to $unset active from links and switches collections that will no longer be in the database. If you are upgrading to 2023.1 you should run this script, however, if you don't, it'll still work as intended since the application won't read from or update these active values

Local Tests

  • I ran this branch with a DB from a previous version with all active in the DB, and as expected no issues showed up.
  • I also ran all scripts command, added them to the scripts README.md, and then also double check in the collections, ensuring it got correctly removed

20230620_172910

rs0 [direct: primary] napps> db.links.findOne()
{
  _id: '4d42dc0852278accac7d9df15418f6d921db160b13d674029a87cef1b5f67f30',
  enabled: true,
  endpoints: [
    { id: '00:00:00:00:00:00:00:02:3' },
    { id: '00:00:00:00:00:00:00:03:2' }
  ],
  id: '4d42dc0852278accac7d9df15418f6d921db160b13d674029a87cef1b5f67f30',
  inserted_at: ISODate("2023-06-20T19:54:51.726Z"),
  metadata: {},
  updated_at: ISODate("2023-06-20T20:13:53.696Z")
}
rs0 [direct: primary] napps> db.switches.findOne()
{
  _id: '00:00:00:00:00:00:00:03',
  connection: '127.0.0.1:53680',
  data_path: 's3',
  enabled: true,
  hardware: 'Open vSwitch',
  id: '00:00:00:00:00:00:00:03',
  inserted_at: ISODate("2023-06-20T19:54:50.467Z"),
  interfaces: [
    {
      id: '00:00:00:00:00:00:00:03:4294967294',
      enabled: true,
      mac: 'c2:9d:dd:f0:f1:4f',
      speed: 0,
      port_number: Long("4294967294"),
      name: 's3',
      nni: false,
      lldp: true,
      switch: '00:00:00:00:00:00:00:03',
      link: '',
      link_side: null,
      metadata: {},
      updated_at: null
    },
    ...
    {
      id: '00:00:00:00:00:00:00:03:3',
      enabled: true,
      mac: '86:62:23:d9:7e:06',
      speed: 1250000000,
      port_number: 3,
      name: 's3-eth3',
      nni: true,
      lldp: true,
      switch: '00:00:00:00:00:00:00:03',
      link: 'c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07',
      link_side: null,
      metadata: {},
      updated_at: null
    }
  ],
  manufacturer: 'Nicira, Inc.',
  metadata: {},
  ofp_version: '0x04',
  serial: 'None',
  software: '3.1.1',
  updated_at: ISODate("2023-06-20T20:14:48.360Z")
}
rs0 [direct: primary] napps> 


End-to-End Tests

+ python3 -m pytest tests/ --reruns 2 -r fEr
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-7.2.0, pluggy-1.0.0
rootdir: /builds/amlight/kytos-end-to-end-tester/kytos-end-to-end-tests
plugins: rerunfailures-10.2, timeout-2.1.0, anyio-3.6.2
collected 232 items
tests/test_e2e_01_kytos_startup.py ..                                    [  0%]
tests/test_e2e_05_topology.py ..................                         [  8%]
tests/test_e2e_10_mef_eline.py ..........ss.....x.....x................  [ 25%]
tests/test_e2e_11_mef_eline.py ......                                    [ 28%]
tests/test_e2e_12_mef_eline.py .....Xx.                                  [ 31%]
tests/test_e2e_13_mef_eline.py .....xs.s......xs.s.XXxX.xxxx..X......... [ 49%]
...                                                                      [ 50%]
tests/test_e2e_14_mef_eline.py x                                         [ 51%]
tests/test_e2e_15_mef_eline.py ..                                        [ 52%]
tests/test_e2e_20_flow_manager.py .....................                  [ 61%]
tests/test_e2e_21_flow_manager.py ...                                    [ 62%]
tests/test_e2e_22_flow_manager.py ...............                        [ 68%]
tests/test_e2e_23_flow_manager.py ..............                         [ 75%]
tests/test_e2e_30_of_lldp.py ....                                        [ 76%]
tests/test_e2e_31_of_lldp.py ...                                         [ 78%]
tests/test_e2e_32_of_lldp.py ...                                         [ 79%]
tests/test_e2e_40_sdntrace.py ...........                                [ 84%]
tests/test_e2e_41_kytos_auth.py ........                                 [ 87%]
tests/test_e2e_50_maintenance.py ........................                [ 97%]
tests/test_e2e_60_of_multi_table.py .....                                [100%]
=============================== warnings summary ===============================
= 210 passed, 6 skipped, 11 xfailed, 5 xpassed, 833 warnings in 10709.59s (2:58:29) =

@viniarck viniarck requested a review from a team as a code owner June 20, 2023 20:42
Base automatically changed from feat/service_interruptions to master June 22, 2023 14:37
@viniarck
Copy link
Member Author

I'll go ahead and prioritize merging this to wrap up 2023.1 for the exploratory tests

@viniarck viniarck merged commit f975191 into master Jun 22, 2023
@viniarck viniarck deleted the chore/remove_active_from_collections branch June 22, 2023 19:26
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.

chore: provide a DB script to $unset active from switches and links and remove from models
1 participant