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

SqlServiceAccount: Expected Get-TargetResource to return 'DatabaseEngine' and 'SqlServerAgent' #981

Closed
johlju opened this issue Dec 30, 2017 · 0 comments · Fixed by #1278
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Dec 30, 2017

Details of the scenario you tried and the problem that is occurring:
When using SqlServiceAccount with the following configuration, I'm expected Get-TargetResource to also return 'DatabaseEngine' and 'SqlServerAgent' as the service type, but it returns 'SqlServer' and 'SqlAgent' respectively.

[-] Should have set the resource and all the parameters should match 670ms
  Expected string length 14 but was 9. Strings differ at index 0.
  Expected: {DatabaseEngine}
  But was:  {SqlServer}
  -----------^
  103:                 $resourceCurrentState.ServiceType    | Should -Be $mockServiceTypeDatabaseEngine
      [-] Should have set the resource and all the parameters should match 1.66s
        Expected string length 14 but was 8. Strings differ at index 3.
        Expected: {SQLServerAgent}
        But was:  {SqlAgent}
        --------------^
        153:                 $resourceCurrentState.ServiceType | Should -Be $mockServiceTypeSqlServerAgent

I suggest we change this so that Get-TargetResource returns 'DatabaseEngine' and 'SqlServerAgent' to be consistent.

The DSC configuration that is using the resource (as detailed as possible):

SqlServiceAccount Integration_Test
{
    ServerName     = $Node.ServerName
    InstanceName   = 'MSSQLSERVER'
    ServiceType    = 'DatabaseEngine'
    ServiceAccount = $SqlServiceSecondaryCredential
    RestartService = $true
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
n/a

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
n/a

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Dec 30, 2017
@johlju johlju changed the title SqlServiceAccount: Expected Get-TargetResource to return 'DatabaseEngine' SqlServiceAccount: Expected Get-TargetResource to return 'DatabaseEngine' and 'SqlServerAgent' Dec 30, 2017
@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Feb 7, 2019
johlju added a commit to johlju/SqlServerDsc that referenced this issue Feb 7, 2019
- Now the correct service type string value is returned by the function
  `Get-TargetResource`. Previously one value was passed in as a parameter
  (e.g. `DatabaseEngine`), but a different string value as returned
  (e.g. `SqlServer`). Now `Get-TargetResource` return the same values
  that can be passed as values in the parameter `ServiceType` (issue dsccommunity#981).
johlju added a commit that referenced this issue Feb 17, 2019
- Changes to SqlServerDsc
  - Update integration tests to use the new integration test template.
- Changes to SqlServiceAccount
  - Now the correct service type string value is returned by the function
    `Get-TargetResource`. Previously one value was passed in as a parameter
    (e.g. `DatabaseEngine`), but a different string value as returned
    (e.g. `SqlServer`). Now `Get-TargetResource` return the same values
    that can be passed as values in the parameter `ServiceType` (issue #981).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant