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

internal [SPM] Add logic to disable the feature before stopping it and enabling it before starting #30

Closed
wants to merge 1 commit into from

Conversation

vadymhlushko-mlnx
Copy link
Owner

What I did

Add logic to disable the feature before stopping and enabling it before starting in order to properly clean the systemd symlinks to avoid issues with delayed attribute explained in the How to verify it section.

How I did it

Add the systemctl disable ... after the systemctl stop... and the systemctl enable ... before the systemctl start .. for some feature.

How to verify it

  • Add repository for some featureX
  • sonic-package-manager repository <featureX> <URL>
  • Install featureX version 1.0.0 where the delayed flag is equal to false (delayed flag means - the feature will be started right after the system boots or after the PortInitDone event)
  • sonic-package-manager install featureX==1.0.0 -y
  • Enable the feature in SONiC
  • config feature state featureX enabled
  • Install featureX version 1.0.1 where the delayed flag is equal to true
  • sonic-package-manager install featureX==1.0.1 -y
  • Check the manifest file to verify the delayed field value
  • sonic-package-manager show package manifest featureX
  • config save -y
  • reboot
  • Check that the featureX is delayed on the system start

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@@ -1017,8 +1017,10 @@ def _get_installed_packages_except(self, package: Package) -> Dict[str, Package]

def _stop_feature(self, package: Package):
self._systemctl_action(package, 'stop')
self._systemctl_action(package, 'disable')
Copy link
Collaborator

Choose a reason for hiding this comment

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

UT?

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.

2 participants