Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
- test/new-e2e/tests/installer/windows/**/*
- test/new-e2e/tests/windows/**/*
- test/new-e2e/tests/sysprobe-functional/**/*
- test/new-e2e/tests/process/**/*

include:
- local: .adms/**/*.yaml
Expand Down
39 changes: 39 additions & 0 deletions test/new-e2e/tests/process/diskspd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.

package process

import (
"fmt"

"github.com/DataDog/datadog-agent/test/e2e-framework/testing/components"
)

const (
diskSpdDir = "C:/diskspd"
diskSpdZipDst = "C:/DiskSpd.zip"
// diskSpdArtifactKey is the object key under the E2E artifact bucket (artifact host; s3://agent-e2e-s3-bucket).
diskSpdArtifactKey = "processes/DiskSpd.zip"
// DiskSpdExe is the path to the amd64 diskspd executable after extraction
// (Microsoft DiskSpd release layout: amd64/diskspd.exe inside the zip).
DiskSpdExe = "C:/diskspd/amd64/diskspd.exe"
Copy link
Copy Markdown
Contributor

@aiuto aiuto Apr 2, 2026

Choose a reason for hiding this comment

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

Is this part of the build images or are we going to actually vendor it into the source?
Or really, processes/DiskSpd.zip? Is that checked in.
My ask is only that if we are actually vendoring anything into the source tree, it lives in /third_party/...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's not vendored in the source it is venodred in a dedicated S3 bucket we use for E2E tests third party dependencies.
https://datadoghq.atlassian.net/wiki/spaces/ADX/pages/5040342019/E2E+-+Use+a+third+party+artifact+in+test

)

// setupDiskSpd downloads DiskSpd from the E2E artifact host and extracts it if not already present.
func setupDiskSpd(host *components.RemoteHost) error {
err := host.HostArtifactClient.Get(diskSpdArtifactKey, diskSpdZipDst)
if err != nil {
return fmt.Errorf("failed to download DiskSpd from artifact bucket: %w", err)
}

_, err = host.Execute(fmt.Sprintf(
`if (-Not (Test-Path -Path '%s')) { Expand-Archive -Path '%s' -DestinationPath '%s' -Force }`,
diskSpdDir, diskSpdZipDst, diskSpdDir))
if err != nil {
return fmt.Errorf("failed to extract DiskSpd: %w", err)
}

return nil
}
15 changes: 6 additions & 9 deletions test/new-e2e/tests/process/windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package process
import (
"encoding/json"
"fmt"
"path/filepath"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -59,13 +60,8 @@ func (s *windowsTestSuite) SetupSuite() {

// Start an antivirus scan to use as process for testing
s.Env().RemoteHost.MustExecute("Start-MpScan -ScanType FullScan -AsJob")
// Install chocolatey - https://chocolatey.org/install
// This may be due to choco rate limits - https://datadoghq.atlassian.net/browse/ADXT-950
stdout, err := s.Env().RemoteHost.Execute("Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr https://community.chocolatey.org/install.ps1 -UseBasicParsing | iex")
require.NoErrorf(s.T(), err, "Failed to install chocolatey: %s, err: %s", stdout, err)
// Install diskspd for IO tests - https://learn.microsoft.com/en-us/azure/azure-local/manage/diskspd-overview
stdout, err = s.Env().RemoteHost.Execute("C:\\ProgramData\\chocolatey\\bin\\choco.exe install -y diskspd")
require.NoErrorf(s.T(), err, "Failed to install diskspd: %s, err: %s", stdout, err)
// DiskSpd for IO tests: zip on E2E artifact host at processes/DiskSpd.zip (see diskspd.go).
require.NoError(s.T(), setupDiskSpd(s.Env().RemoteHost))
}

func (s *windowsTestSuite) TestAPIKeyRefresh() {
Expand Down Expand Up @@ -323,7 +319,7 @@ func runDiskSpd(t *testing.T, remoteHost *components.RemoteHost) (string, []stri
// -Sh: Disable both software caching and hardware write caching.
// -w50: Write percentage
cmd := []string{
"diskspd",
DiskSpdExe,
"-d120",
"-c128M",
"-t2",
Expand All @@ -349,5 +345,6 @@ func runWindowsCommand(t *testing.T, remoteHost *components.RemoteHost, cmd []st
_ = session.Close()
_ = stdin.Close()
})
return cmd[0] + ".exe", nil
// Payloads use the executable file name (e.g. diskspd.exe), not the full path.
return filepath.Base(cmd[0]), nil
}
Loading