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

Provider Improvements and Fixes #1249

Merged

Commits on Jul 26, 2023

  1. driver/provider: rename NFSPProviderDriver -> NFSProviderDriver

    The typo has been in the class name since its introduction. The
    documentation contains the correct name "NFSProviderDriver" already.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    8ff4742 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. resource: import NFSProvider, HTTPProvider

    This allows the user to import these resources from labgrid.resource
    directly.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    7316e25 View commit details
    Browse the repository at this point in the history
  2. driver/provider: fix BaseProviderDriver with local resources

    The TFTPProvider, HTTPProvider and NFSProvider don't have a host
    property unlike the remote variants.
    
    Fix the `get_export_vars()` method by distinguishing local and remote
    resources: use the provider's host attribute for remote resources,
    otherwise return "localhost".
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    e8dbe63 View commit details
    Browse the repository at this point in the history
  3. driver/provider: drop BaseProviderDriver.__attrs_post_init__()

    There is no need to overwrite this method to only call the same method
    on super(). This is the default.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    1a53a26 View commit details
    Browse the repository at this point in the history
  4. util/managedfile: expose user cache path

    This path will be used by the NFSProviderDriver in a future commit.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    14a258e View commit details
    Browse the repository at this point in the history
  5. driver/provider: adjust NFSProviderDriver to NFS mounting use cases

    During the introduction of the provider drivers, it was assumed all
    provider drivers work the same way: by relying on the
    `internal`/`external` attributes of their corresponding provider
    resource and symlinking the required file (either from
    /var/cache/labgrid/$USER/$HASH/file or the given path, in case it's
    locally available) to the `internal` path. For the target, the file
    is now expected to be available below `external` as returned by
    `stage()`.
    
    This, however, does not work for NFS: all NFS servers known to me
    don't touch the symlinks, meaning in our case that they point to a
    location not exported via NFS. Exporting and mounting these destinations
    to the same location is impractical at best or does not work at all.
    On top of that, the `internal`/`external` lingo does not fit the NFS
    mount use case.
    
    To improve this situation, introduce a custom `stage()` method for the
    NFSProviderDriver: assume that /var/cache/labgrid is exported via NFS,
    always copy the file to be staged there (even if it would be locally
    available) and return an NFSFile object containing the information
    required to mount and access the NFS share: host, export and the file
    path relative to the export.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    a092969 View commit details
    Browse the repository at this point in the history
  6. resource: do not let (Remote)NFSProvider inherit from (Remote)BasePro…

    …vider
    
    Now that the NFSProviderDriver no longer relies on the
    `internal`/`external` attributes of the (Remote)NFSProvider resource,
    let the NFSProvider inherit from Resource directly, so specifying these
    obsolete attributes is no longer required. The same applies to the
    RemoteNFSProvider which now inherits from NetworkResource directly.
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    1a66ea5 View commit details
    Browse the repository at this point in the history
  7. doc/configuration: document remote provider arguments and provide exa…

    …mples
    
    Signed-off-by: Bastian Krause <[email protected]>
    Bastian-Krause committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    c345273 View commit details
    Browse the repository at this point in the history