about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/am/amazon-ssm-agent/0001-Disable-NIC-tests-that-fail-in-the-Nix-sandbox.patch
blob: 364f7653efa3cbcc1abf962960d9326531315399 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From bea6307ec2a77d90d59c13940381d73ec0f05b70 Mon Sep 17 00:00:00 2001
From: Graham Christensen <graham@grahamc.com>
Date: Mon, 1 Mar 2021 10:57:44 -0500
Subject: [PATCH] Disable NIC tests that fail in the Nix sandbox.

---
 agent/managedInstances/fingerprint/fingerprint_integ_test.go | 2 ++
 agent/ssm/service_test.go                                    | 1 +
 2 files changed, 3 insertions(+)

diff --git a/agent/managedInstances/fingerprint/fingerprint_integ_test.go b/agent/managedInstances/fingerprint/fingerprint_integ_test.go
index a1f969ff..631ea1f5 100644
--- a/agent/managedInstances/fingerprint/fingerprint_integ_test.go
+++ b/agent/managedInstances/fingerprint/fingerprint_integ_test.go
@@ -28,12 +28,14 @@ func TestHostnameInfo(t *testing.T) {
 }
 
 func TestPrimaryIpInfo(t *testing.T) {
+	t.Skip("The Nix build sandbox has no non-loopback IPs, causing this test to fail.");
 	ip, err := primaryIpInfo()
 	assert.NoError(t, err, "expected no error fetching the primary ip")
 	assert.NotEmpty(t, ip, "expected to fetch primary ip")
 }
 
 func TestMacAddrInfo(t *testing.T) {
+	t.Skip("The Nix build sandbox has no non-loopback interfaces, causing this test to fail.");
 	mac, err := macAddrInfo()
 	assert.NoError(t, err, "expected no error fetching the mac addr")
 	assert.NotEmpty(t, mac, "expected to fetch mac address")
diff --git a/agent/ssm/service_test.go b/agent/ssm/service_test.go
index f4b34f83..d8216dba 100644
--- a/agent/ssm/service_test.go
+++ b/agent/ssm/service_test.go
@@ -85,6 +85,7 @@ func (suite *SsmServiceTestSuite) TestUpdateEmptyInstanceInformation() {
 // Test function for update instance information
 // This function update the agent name, agent statuc, and agent version.
 func (suite *SsmServiceTestSuite) TestUpdateInstanceInformation() {
+	suite.T().Skip("The Nix build sandbox has no interfaces for IP and MAC address reports.");
 	// Give mock value to test UpdateInstanceInformation, assert the error is nil, assert the log.Debug function get called.
 	response, err := suite.sdkService.UpdateInstanceInformation(suite.logMock, "2.2.3.2", "active", "Amazon-ssm-agent")
 	assert.Nil(suite.T(), err, "Err should be nil")
-- 
2.29.2