Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1229 commits
Select commit Hold shift + click to select a range
18fc580
use Eventually when checking /privileged route
crhino Aug 29, 2017
b66dbfc
Use diego logging client instead of go-loggregator
enocom Aug 21, 2017
0c76e91
Add inigo test for unmount CSI volume
Kaixiang Aug 23, 2017
21ede54
Test the mount purger for localdriver
Kaixiang Aug 24, 2017
d9d1524
Reorder Cleanup of executor to after process shutdown
crhino Sep 28, 2017
e361759
change the data types to match what the rep expects
jvshahid Oct 18, 2017
f598879
Add FS driver flag to grootfs init-store invocation.
Oct 30, 2017
8526744
pass an admin port to the routing-api
jvshahid Nov 1, 2017
cf52aa4
add tests for container proxy cert rotation
nimakaviani Oct 25, 2017
8762d3d
wip
nimakaviani Nov 10, 2017
6c4cece
remove a println
Nov 10, 2017
6bebc0b
Add tests for scaling memory when running container proxy
Nov 10, 2017
0de9361
remove some comments
jvshahid Nov 13, 2017
9630a72
remove a redundant test
jvshahid Nov 13, 2017
4454576
reset the container pointer to nil before every test
jvshahid Nov 13, 2017
b98358d
let the OS decide on which port to use in order to make the test less…
jvshahid Nov 17, 2017
344b4fc
use signed math to avoid underflow if the actual memory usage is higher
jvshahid Nov 17, 2017
190a0a4
add a flag to cause the go-server to consume constant amount of memory
jvshahid Nov 17, 2017
40cfa17
make sure the go-server has high memory usage and increase the test t…
jvshahid Nov 17, 2017
9562364
remove some unused/unreachable code
Nov 17, 2017
df151e7
add inigo test to ensure envoy proxy runs for lrps that use OCI rootf…
jvshahid Nov 20, 2017
ea11b36
declarative healthcheck sidecar containers work in inigo
crhino Nov 28, 2017
520e933
run a "metron-agent" to read log messages for better troubleshooting
jvshahid Nov 28, 2017
38a0a0c
ensure all temporary directories are readable by unprivileged containers
jvshahid Nov 29, 2017
9141d46
add fake metron agent to the instance identity test suite
jvshahid Nov 29, 2017
0e4834f
find out the instance address and port using BBS
jvshahid Nov 29, 2017
80eeb1d
update docker envoy tests to reflect there new scaled memory allocations
crhino Nov 29, 2017
6b2305a
fix healthchecks and envoy container proxy on privileged containers
jvshahid Nov 30, 2017
37abf9c
Test envoy rejects connects with unapproved cipher suites
Dec 5, 2017
c9163c0
Create internal portauthority package to manage port allocations.
Dec 6, 2017
7e45a64
update test assertion to check for substring
crhino Dec 7, 2017
cf2a6ba
add an inigo test to ensure memory isn't scaled if container proxy is…
jvshahid Dec 14, 2017
970dfee
add an inigo test to ensure connections to app stay open as long as t…
jvshahid Dec 15, 2017
f5cbc85
get rid of the custom reporters
jvshahid Dec 15, 2017
c4afe71
make the pool size smaller
jvshahid Dec 15, 2017
e373070
use the port allocator to allocate garden's port pool
jvshahid Dec 15, 2017
940d571
make some changes to the inigo helpers to make them usable from dusts
nimakaviani Dec 22, 2017
b7b7a38
add inigo test to ensure that apps aren't marked running until Envoy …
jvshahid Jan 4, 2018
64e2387
Changes to support rolling upgrade tests in dusts
goonzoid Jan 8, 2018
17e9af2
Add assertions to ensure source and destination aren't empty
jvshahid Jan 8, 2018
148d8a6
Improve ComponentMaker api
jvshahid Jan 8, 2018
7daa493
change onsi/grace-busybox -> cfdiegodocker/grace
Jan 13, 2018
e643566
modify inigo to be compatible with garden-runc v1.11.0
jvshahid Jan 16, 2018
3beb61b
only support running inigo with grootfs
jvshahid Jan 16, 2018
963b346
Ensure world.Components are v1.0.0 compatible
crhino Jan 17, 2018
338b2d1
use overlay instead of btrfs for groot
jvshahid Jan 17, 2018
dad8a25
get rid of the store size to prevent grootfs from managing the store
caod123 Jan 18, 2018
80c5059
Change v0 Rep configuration to allow v0 vizzini to pass cells_test.go
crhino Jan 18, 2018
87b39ee
get rid of lds references from inigo
nimakaviani Jan 19, 2018
81e4749
Expect curl to exit with code 7 when denied network access
crhino Jan 19, 2018
8aa6366
rename Csi to CSI to conform to Golang naming conventions
Jan 23, 2018
9a8f83c
start route-emitter with consul lock enabled
goonzoid Jan 24, 2018
e0abf72
Add csiVolume support in inigo executor test
Kaixiang Jan 25, 2018
626c265
move csiplugin repo into cloudfoundry org
Jan 26, 2018
f8c398c
set logLevel to debug for local node plugin
Jan 26, 2018
a4db848
Make the cache directory readable by everyone
jvshahid Jan 29, 2018
ae3dfdb
Allow users of ComponentMaker to pass a port allocator
jvshahid Jan 30, 2018
6ff3c26
Additional CSI coverage
Kaixiang Feb 1, 2018
3482958
add test to ensure rep doesn't hang during evacuation even if garden did
jvshahid Feb 2, 2018
5ef657a
Fix port range for portAllocator
goonzoid Feb 2, 2018
cf7080b
Bump stop process timeout to 20s
caod123 Feb 7, 2018
76303c0
use https to communicate with BBS and Rep since both require tls
jvshahid Feb 13, 2018
760e8a0
get rid of etcd references
flawedmatrix Feb 16, 2018
2b9e874
Set new locket enabled flag in components
goonzoid Feb 20, 2018
0476079
wait for each process to stop before stopping subsequent processes
Feb 21, 2018
9285e0f
add a test to ensure apps that listen on localhost are still routable…
jvshahid Feb 22, 2018
05ff17e
deprecate EnableLegacyAPIServer
jvshahid Feb 23, 2018
72da750
Remove ExportNetworkEnvVars field
Feb 26, 2018
a53a46b
fix `UnixNano` to be a function call
nimakaviani Feb 26, 2018
9d68552
Use loggregator v2, v1 no longer supported
jvshahid Feb 26, 2018
30de592
Stop specifying LegacyDownloadUser for DesiredLRPs and Tasks
goonzoid Mar 2, 2018
ffd64c1
fix initializer function by passing an empty cell id
nimakaviani Mar 5, 2018
dc05214
make test docker:// cleaner when skipping private docker registry tests
sjolicoeur Mar 14, 2018
471e7dd
fix the compilation issue
nimakaviani Mar 14, 2018
1e3bf10
cell: add test for unlimited LRP memory with additional proxy memory
charlievieth Mar 29, 2018
bd2389f
fix the threshold check for inigo
nimakaviani Mar 30, 2018
e57d85d
fix the test
jvshahid Apr 3, 2018
9fdbce9
fix executor initialization for volman
nimakaviani Apr 4, 2018
1e82d01
update the expected mount path for csi plugin
Kaixiang Apr 30, 2018
bfbbed7
allow all traffic from the task
jvshahid May 1, 2018
f6f0fa6
Increase garden's port pool size
jvshahid May 3, 2018
f4eca40
lower the poolsize a bit to avoid running out of ports
jvshahid May 3, 2018
cac0d99
make garden's port pool size configuration
nimakaviani May 3, 2018
546e384
Update to use new AcutalLRPGroup.Resolve function
sjolicoeur May 17, 2018
d1cd5ee
No need to panic in AfterSuite if BeforeSuite fails
sjolicoeur May 17, 2018
30af545
refactor AllocateContainers and remove the returned error
nimakaviani May 29, 2018
b68fa0f
rename initialize -> create for failing container
jvshahid Jun 14, 2018
72bf174
verify mutual tls configuration for instance identity
nimakaviani Jul 19, 2018
f297aef
a missing cell now moves lrps to a suspect presence
nimakaviani Jul 24, 2018
80dc329
Enable unproxied port mappings in inigo
jvshahid Jul 27, 2018
bc1d907
Update convergence tests to accommodate suspect LRP feature flag
dsabeti Jul 27, 2018
3872c59
Fix typo (acutal => actual) [#159334610](https://www.pivotaltracker.c…
dsabeti Aug 2, 2018
724c4cc
Add missing parameters in
nimakaviani Sep 12, 2018
05a186b
Update volman tests for unique volume IDs
Sep 18, 2018
cb2ccdd
Make sure the DeclarativeHealthcheckPath is valid
jvshahid Sep 28, 2018
a21e470
fix a typo
jvshahid Oct 13, 2018
dda9d74
use more descriptive names
jvshahid Oct 13, 2018
5592825
fix the tests which previously didn't expect the new garden cpu entit…
jvshahid Oct 13, 2018
5a18cf8
Update for dockerdriver repo rename (ne voldriver)
davewalter Nov 1, 2018
bb8cc9f
Merge branch 'pr/20'
nimakaviani Nov 1, 2018
7e29c42
Update certificates in fixutres
flawedmatrix Nov 16, 2018
a2229e6
Bump to csi v1.0.0
Nov 16, 2018
15e6381
Update for new location of local-node-plugin repo
davewalter Nov 17, 2018
44e99ff
enable automatic cert generation
flawedmatrix Nov 26, 2018
009b1a5
use CertAuthority to generate CA / server / client certs
Nov 22, 2018
f0f6dd8
use variadic config modification funcs for v0 / v1 components
nimakaviani Nov 22, 2018
dbaefd1
use GardenRunner.Start to start the garden process
nimakaviani Nov 28, 2018
7af9125
Simplify garden startup and set StartCheck ourselves
sunjayBhatia Nov 28, 2018
9b3809d
Use new location of rootfs config
Dec 7, 2018
307c7c6
remove GenerateSuspectActualLRPs
Jan 15, 2019
eb0e5cf
Update certs
flawedmatrix Feb 14, 2019
d07915c
Auto generate certs in instance identity tests
flawedmatrix Feb 15, 2019
cd74d3d
Updates for proto3
Feb 20, 2019
d89ca8b
updated TLS config to use tlsconfig
sunjayBhatia Feb 19, 2019
c1f2f72
Update the cert
flawedmatrix Feb 25, 2019
fd956bb
used cfhttp v2 for client generation
Feb 25, 2019
5e1799a
set the request timeout on rep clients to 10s
flawedmatrix Feb 27, 2019
5f71625
Update expired certs
Mar 5, 2019
e884d30
Add ReportInterval for the repconfig
Mar 6, 2019
42e70f0
cflinuxfs{2,3}
Apr 19, 2019
414d9ec
Explicitly listen on a port "-p" flag
sunjayBhatia Apr 24, 2019
a2a3524
Update to new routingapi interface
mariash May 23, 2019
17162ff
Revert "Update to new routingapi interface"
mariash May 23, 2019
478f6ca
Introduce a configurable ifrit startcheck timeout
DennisDenuto May 31, 2019
544b563
Only parse duration once (in component maker constructor)
mariash Jun 5, 2019
cf30b1e
fix Route Emitter config
Jun 21, 2019
70abd13
Use updated executor Initialize args
sunjayBhatia Jun 26, 2019
79c1220
Regenerate expired certs
sunjayBhatia Jul 19, 2019
c599cde
Add localhost for sql-certs CN
Jul 22, 2019
5b16800
routingapi now requires mTLS certs and port
Jul 23, 2019
e498fb6
Refactor inigo to run instance_identity_test on Windows
Jul 19, 2019
47c292d
set instanceGUID for looking up container
mariash Jul 23, 2019
0ab1252
remove limit on max containers in garden
mariash Jul 23, 2019
38aa015
Windows needs a max container limit b/c it uses an image plugin
sunjayBhatia Jul 25, 2019
eba7baf
Skip unsupported tests for envoy-nginx
Jul 31, 2019
b01e5b2
Default to 1024 DiskMB for lrps
Jul 31, 2019
2b375ed
Pass rootFSes in the Initialize
sunjayBhatia Jul 31, 2019
18e1aca
Remove executor initializer tests that are no longer relevant
Jul 31, 2019
71ec74a
Revert "Default to 1024 DiskMB for lrps"
Jul 31, 2019
49e7ef4
Convert ActualLRPGroup bbs calls to ActualLRPs
sunjayBhatia Aug 1, 2019
c7e6bf2
Ensure LRPStatePoller is backward compatible for v1.0.0 and v1.25.0
Aug 1, 2019
4ca1392
Interrupt starts evacuation, let's kill the rep instead
Aug 1, 2019
4826556
Suspect convergence test: just check for presence
Aug 2, 2019
6a84465
Correctly pull the ActualLRP with a given presence
Aug 5, 2019
2e562af
remove CSI support from Diego
DennisDenuto Aug 12, 2019
1a34adb
Fix inigo for changes made to routing api runner
sunjayBhatia Aug 20, 2019
cdc9c6a
Use lock when generating CA and Certs
Aug 22, 2019
08d1eed
Increase polling interval
Aug 23, 2019
a6010d0
Add caLock around generation of intermediate CA func
sunjayBhatia Aug 30, 2019
62e2f8f
Add tests for ECR image
mariash Sep 13, 2019
52ec343
Ensure parallel group is terminated on start error on Windows
sunjayBhatia Sep 16, 2019
b85e964
Add a CellID filter to ensure we only get 1 LRP
sunjayBhatia Sep 17, 2019
4d57c5d
updated tests to be compatible with latest lib bump
Oct 9, 2019
a0283b8
changed the invalid cipher suite test back
Oct 11, 2019
ff86fb9
reformat
sunjayBhatia Oct 25, 2019
2175e4b
Update gnatsd to nats-server
mariash Nov 11, 2019
75e8d5b
Close files so they can be deleted on Windows
sunjayBhatia Nov 13, 2019
76b35a9
Cleanup temporary directories
mariash Nov 22, 2019
3d6fc2c
Move AfterEach to the correct place
mariash Nov 25, 2019
0cc9a21
Delete temp files after processes are stopped
sunjayBhatia Nov 25, 2019
aad9e2b
Add a tmpDir to component maker
sunjayBhatia Nov 26, 2019
d9ee33a
use suiteTempDir for envoy_config
Nov 26, 2019
cf4c91f
use the parent tmpDir for cleanup
Nov 26, 2019
e43a154
defer closing the configFiles
Dec 3, 2019
1842ec7
Update README with URL to diego-release issues
mariash Jan 21, 2020
155a345
Update PR template
mariash Jan 25, 2020
a248a2e
content change
heyjcollins Jan 30, 2020
4f5082a
Update PULL_REQUEST_TEMPLATE.md
heyjcollins Jan 31, 2020
11876c0
Loosen the expected timeout for healthcheck
mariash Feb 6, 2020
947e553
Remove the dependency on cf-test-helpers
jvshahid Mar 6, 2020
597cd5d
MaxPathLenZero hack does not work on updated certstrap
mdelillo Mar 18, 2020
738c5b3
Use jackc/pgx instead of lib/pq
May 9, 2020
8c6981a
Loosen evacuation test assertion on list of LRPs
mdelillo Aug 10, 2020
f715d2a
Add domain SAN for go 1.15 changes
Dec 7, 2020
9d8f990
Add domain SAN for sql-certs for go 1.15 changes
Dec 8, 2020
9dd7611
Use RFC3339 timestamp for all components
Dec 8, 2020
aea72a8
Change assertion message in file descriptor limit task test.
pivotalgeorge Feb 27, 2021
c8d03e7
Revert "Change assertion message in file descriptor limit task test."
Mar 29, 2021
652d760
Build gdn from the submodule
May 14, 2021
3730666
Revert "Build gdn from the submodule"
May 14, 2021
088d87b
build gdn outside of code.cloudfoundry.org module
May 14, 2021
1a10abd
Convert pathing for go mod'ed tests
jrussett May 19, 2021
44d1973
Remove *_GOPATH references
May 24, 2021
db6f673
fix executor's suite
May 25, 2021
398dc79
Change assertion message in file descriptor limit task test.
pivotalgeorge Feb 27, 2021
6d2accd
Build gorouter with GO111MODULE
Jun 3, 2021
4bdc4f6
Use the correct import path
Jun 15, 2021
920a4a0
Build gorouter in a module aware release
Sep 28, 2021
e0c15b4
Update gorouter config for nats
Sep 29, 2021
c842b49
RouterStatus port should be unique
Sep 29, 2021
abc9b04
Use the correct key for certauthority
Oct 14, 2021
7b953a3
Increase the timeout waiting for cells
reneighbor Oct 19, 2021
031ac17
Revert "Increase the timeout waiting for cells"
mariash Oct 21, 2021
937ed4b
Regenerate certs for tests
jrussett Jul 8, 2022
fa8f676
Replace GinkgoParallelNode with GinkgoParallelProcess
ebroberson Jul 19, 2022
9179fa2
Remove consul from Inigo + tests
geofffranks Oct 17, 2022
d4b42d2
Update docker images to be built into cloudfoundry org
geofffranks Feb 13, 2023
9027812
Add MetricTags to lrpCreateRequest helper (#23)
ctlong Feb 27, 2023
d863bb2
Fix bbs request helpers (#24)
ctlong Feb 28, 2023
18bab03
Update ssh test with MetricTags
mariash Feb 28, 2023
3c8b1a8
Bump to ginkgo/v2 & lager/v3 (#25)
winkingturtle-vmw Apr 6, 2023
c1bc9f5
Run trace id test in inigo (#26)
mariash May 23, 2023
8e5bf0c
Do not run log trace id test on windows
mariash May 24, 2023
b300679
Add CODEOWNERS file in preparation for branch protection rules (#27)
geofffranks Jun 12, 2023
0b9fa4d
Make go vet pass
jrussett Oct 19, 2023
faa59ea
Make go vet pass, pt 2
jrussett Oct 19, 2023
04c069a
With oss ci export (#28)
winkingturtle-vmw Nov 14, 2023
b539824
Use port generator for Router routes endpoint
jrussett Dec 5, 2023
4fa940a
Set Router routes address in volman and executor suites
jrussett Dec 6, 2023
05b7070
Garden rootfs will be provided in pipeline as an input
mariash Dec 6, 2023
75783a2
GARDEN_ROOTFS -> GARDEN_TEST_ROOTFS (#29)
winkingturtle-vmw Dec 7, 2023
8429a5f
After bumping runc to latest (1.1.12) (#30)
winkingturtle-vmw Feb 8, 2024
81d2a07
remove unneded selects
geofffranks Feb 27, 2024
38be392
Remove extraneous append call
geofffranks Feb 28, 2024
4e2e9b8
Check errors before overwriting them with new errors
geofffranks Feb 28, 2024
b9fcf4f
Remove unused code
geofffranks Feb 29, 2024
ee21a38
Stop using deprecated ioutil package
geofffranks Feb 29, 2024
6ee889e
Switch tests to ActualLRPInstance event stream (#32)
geofffranks Mar 21, 2024
563aea6
Update go-loggregator to v9 (#33)
Birdrock May 21, 2024
18074ea
Regenerate certs
mariash Aug 6, 2024
3d1daff
Fix file/dir creation permissions
geofffranks Sep 13, 2024
0b7dbcf
Catch or explicitly ignore unhandled errors (#35)
geofffranks Sep 25, 2024
d30700a
Update broken links in docs (#36)
geofffranks Oct 8, 2024
5727c0d
Use Server struct to address gosec G114 (#37)
andy-a-d-nguyen Oct 9, 2024
4f7d937
Fixing a typo
MarcPaquette Oct 17, 2024
e9e0b6e
Increase timeout for decrease of testing resources (#39)
MarcPaquette Oct 18, 2024
1c943b4
Add read header timeout to address G112 (#40)
geofffranks Oct 18, 2024
68c9d67
Increase timeout to 10s for announcement server (#41)
ebroberson Oct 24, 2024
31bb0a3
More fixes for uint16 ports (#42)
geofffranks Nov 5, 2024
682c3a9
Update inigo to reserve specific routeservices internal port so it do…
geofffranks Nov 18, 2024
93b67cf
Flush dns after updating hosts file, just in case it helps with the f…
geofffranks Nov 20, 2024
bb06558
Bump in runc (#46)
winkingturtle-vmw Jan 17, 2025
129ab4c
Adjust the tests per the new functionality
Ivo1116 Feb 5, 2025
7a5d091
Add coverage for extra-rootfs-dir in rep (#51)
winkingturtle-vmw Mar 13, 2025
b38fe33
Only add ExtraRootfsDir in case of linux runs
winkingturtle-vmw Mar 13, 2025
f4eb115
Skip extra preloaded rootfs tests on windows inigo
geofffranks Apr 17, 2025
7492fbf
Update inigo's path for building gorouter (#53)
geofffranks Jun 4, 2025
059d215
Update tests so DeclarativeHealthCheckDefaultTimeout is set to its de…
plamen-bardarov Jun 5, 2025
a052e5d
cleanup rep require tls property
kart2bc Jun 26, 2025
14ef7aa
set enableDeclarativeHealthCheck always to true (#55)
kart2bc Jul 8, 2025
87a044b
Set required DeclarativeHealthCheckDefaultTimeout
mariash Jul 29, 2025
5847559
Fix duration type
mariash Jul 29, 2025
f1dbd14
Add missing UUID
mariash Aug 5, 2025
9f8b6a2
Add route-emitter UUID on V1 component maker
mariash Aug 5, 2025
085e77e
Use real healthcheck instead dummy
mariash Aug 7, 2025
fc6e947
Rename healthcheck binary to exe on windows
mariash Aug 8, 2025
dea0a5c
Ignore delete errors
mariash Aug 8, 2025
d34d08c
remove inigo submodule entry
kart2bc Aug 26, 2025
cac845a
Add 'src/code.cloudfoundry.org/inigo/' from commit 'dea0a5c911469d9df…
kart2bc Aug 26, 2025
18b1378
Inline submodule inigo into main repo
kart2bc Aug 26, 2025
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
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
path = src/code.cloudfoundry.org/healthcheck
url = https://github.com/cloudfoundry/healthcheck
branch = main
[submodule "src/code.cloudfoundry.org/inigo"]
path = src/code.cloudfoundry.org/inigo
url = https://github.com/cloudfoundry/inigo
branch = main
[submodule "src/code.cloudfoundry.org/locket"]
path = src/code.cloudfoundry.org/locket
url = https://github.com/cloudfoundry/locket
Expand Down
1 change: 0 additions & 1 deletion src/code.cloudfoundry.org/inigo
Submodule inigo deleted from dea0a5
3 changes: 3 additions & 0 deletions src/code.cloudfoundry.org/inigo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.test
fixtures/dockerapp/dockerapp
scripts/.drone.yml
191 changes: 191 additions & 0 deletions src/code.cloudfoundry.org/inigo/bin/test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
#!/bin/bash

set -eu
set -o pipefail

source "$CI_DIR/shared/helpers/filesystem-helpers.bash"
source "$CI_DIR/shared/helpers/helpers.bash"

# Setup DNS for *.service.cf.internal, used by the Diego components, and
# *.test.internal, used by the collocated DUSTs as a routable domain.
function setup_dnsmasq() {
local host_addr
host_addr=$(ip route get 8.8.8.8 | head -n1 | awk '{print $7}')

dnsmasq --address=/service.cf.internal/127.0.0.1 --address=/test.internal/${host_addr}
echo -e "nameserver $host_addr\n$(cat /etc/resolv.conf)" > /etc/resolv.conf
}

function setup_gardenrunc() {
pushd ${GARDEN_RUNC_RELEASE_PATH}
export PATH=${PWD}/bin:${PATH}
export GARDEN_BINPATH=${PWD}/bin/
export GROOTFS_BINPATH=${PWD}/bin/

mkdir -p ${GARDEN_BINPATH}
cp "${TAR_BINARY}" "${GARDEN_BINPATH}/tar"
cp "${NSTAR_BINARY}" "${GARDEN_BINPATH}/nstar"
cp "${RUNC_BINARY}" "${GARDEN_BINPATH}/runc"
cp "${DADOO_BINARY}" "${GARDEN_BINPATH}/dadoo"
cp "${GROOTFS_BINARY}" "${GARDEN_BINPATH}/grootfs"
cp "${GROOTFS_TARDIS_BINARY}" "${GARDEN_BINPATH}/tardis"
cp "${INIT_BINARY}" "${GARDEN_BINPATH}/init"
popd
}

function create_garden_storage() {
# Configure cgroup
mount -t tmpfs cgroup_root /sys/fs/cgroup
mkdir -p /sys/fs/cgroup/devices
mkdir -p /sys/fs/cgroup/memory

mount -tcgroup -odevices cgroup:devices /sys/fs/cgroup/devices
devices_mount_info=$(cat /proc/self/cgroup | grep devices)
devices_subdir=$(echo $devices_mount_info | cut -d: -f3)

# change permission to allow us to run mknod later
echo 'b 7:* rwm' > /sys/fs/cgroup/devices/devices.allow
echo 'b 7:* rwm' > /sys/fs/cgroup/devices${devices_subdir}/devices.allow

# Setup loop devices
for i in {0..256}
do
rm -f /dev/loop$i
mknod -m777 /dev/loop$i b 7 $i
done

# Make XFS volume
truncate -s 8G /xfs_volume
mkfs.xfs -b size=4096 /xfs_volume

# Mount XFS
mkdir /mnt/garden-storage
mount -t xfs -o pquota,noatime /xfs_volume /mnt/garden-storage
chmod 777 -R /mnt/garden-storage

umount /sys/fs/cgroup/devices
}

setup_grootfs () {
# Set up btrfs volume and loopback devices in environment
create_garden_storage
umount /sys/fs/cgroup

groupadd iamgroot -g 4294967294
useradd iamgroot -u 4294967294 -g 4294967294
echo "iamgroot:1:4294967293" > /etc/subuid
echo "iamgroot:1:4294967293" > /etc/subgid
}

setup_diego_release() {
pushd ${DIEGO_RELEASE_PATH}

export CODE_CLOUDFOUNDRY_ORG_MODULE="$PWD/src/code.cloudfoundry.org"
export GUARDIAN_MODULE="$PWD/src/guardian"
popd
}

setup_database() {
orig_ca_file="${DIEGO_RELEASE_PATH}/src/code.cloudfoundry.org/inigo/fixtures/certs/sql-certs/server-ca.crt"
orig_cert_file="${DIEGO_RELEASE_PATH}/src/code.cloudfoundry.org/inigo/fixtures/certs/sql-certs/server.crt"
orig_key_file="${DIEGO_RELEASE_PATH}/src/code.cloudfoundry.org/inigo/fixtures/certs/sql-certs/server.key"

ca_file="/tmp/server-ca.crt"
cert_file="/tmp/server.crt"
key_file="/tmp/server.key"

# do not chown/chmod files in the inigo repo that is annoying
cp $orig_ca_file $ca_file
cp $orig_cert_file $cert_file
cp $orig_key_file $key_file

chmod 0600 "$ca_file"
chmod 0600 "$cert_file"
chmod 0600 "$key_file"

if [ "${DB}" = "mysql" ]; then
pkill mysqld && while pgrep -l mysqld; do sleep 1;done;

chown mysql:mysql "$ca_file"
chown mysql:mysql "$cert_file"
chown mysql:mysql "$key_file"

local server_cnf_path="/etc/mysql/conf.d/docker.cnf"
echo "max_connections = 2000" >> "${server_cnf_path}"
echo "ssl-cert = $cert_file" >> "${server_cnf_path}"
echo "ssl-key = $key_file" >> "${server_cnf_path}"
echo "ssl-ca = $ca_file" >> "${server_cnf_path}"

cat << EOF > /etc/my.cnf
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
EOF
local datadir=/mysql-datadir
local escaped_datadir=${datadir/\//\\\/}
mkdir $datadir
mount -t tmpfs -o size=2g tmpfs $datadir
retry_command "rsync -aq /var/lib/mysql/ $datadir"
sed -i "s/#datadir.*/datadir=${escaped_datadir}/g" "${server_cnf_path}"

else
local pg_conf=$(ls /etc/postgresql/*/main/postgresql.conf)
sed -i 's/max_connections = 100/max_connections = 2000/g' "${pg_conf}"

chown postgres:postgres "$ca_file"
chown postgres:postgres "$cert_file"
chown postgres:postgres "$key_file"

sed -i 's/ssl = false/ssl = true/g' "${pg_conf}"
sed -i "s%ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'%ssl_cert_file = '$cert_file'%g" "${pg_conf}"
sed -i "s%ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'%ssl_key_file = '$key_file'%g" "${pg_conf}"
sed -i "s%#ssl_ca_file = ''%ssl_ca_file = '$ca_file'%g" "${pg_conf}"
fi

configure_db "${DB}"
}

# Update to concourse 2.7.3 and garden-runc 1.4.0 caused inigo to fail since
# resolv.conf is now bind-mounted in. Removing the apt-get install, two inigo
# tests were failing because they were unable to resolve DNS names.
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

setup_dnsmasq
setup_gardenrunc
setup_grootfs

export ROUTER_GOPATH="$ROUTING_RELEASE_PATH/src/code.cloudfoundry.org"
export ROUTING_API_GOPATH=${ROUTER_GOPATH}

setup_diego_release

export APP_LIFECYCLE_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export AUCTIONEER_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export BBS_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export FILE_SERVER_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export HEALTHCHECK_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export LOCKET_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export REP_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export ROUTE_EMITTER_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export SSHD_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export SSH_PROXY_GOPATH=${CODE_CLOUDFOUNDRY_ORG_MODULE}
export GARDEN_GOPATH=${GUARDIAN_MODULE}

# used for routing to apps; same logic that Garden uses.
EXTERNAL_ADDRESS=$(ip route get 8.8.8.8 | sed 's/.*src\s\(.*\)\suid.*/\1/;tx;d;:x')
export EXTERNAL_ADDRESS

setup_database

# display ginkgo dots properly
export LESSCHARSET=utf-8

# workaround until Concourse's garden sets this up for us
filesystem_mount_sysfs
filesystem_permit_device_control
filesystem_create_loop_devices 256

# shellcheck disable=SC2068
# Double-quoting array expansion here causes ginkgo to fail
echo "Log Dir: /tmp/inigo-logs"
mkdir /tmp/inigo-logs
go run github.com/onsi/ginkgo/v2/ginkgo ${@} --output-dir /tmp/inigo-logs --json-report report.json
113 changes: 113 additions & 0 deletions src/code.cloudfoundry.org/inigo/bin/test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
$ErrorActionPreference = "Stop";
trap { $host.SetShouldExit(1) }

$env:GOROOT=(Get-ChildItem "C:\var\vcap\packages\golang-*-windows\go").FullName
$env:PATH= "$env:GOROOT\bin;$env:PATH"
$env:TMP = "C:\var\vcap\data\tmp"
$env:TEMP = "C:\var\vcap\data\tmp"

function Setup-DnsNames() {
Write-Host "Setup-DnsNames"
Add-Content -Path "C:\Windows\System32\Drivers\etc\hosts" -Encoding ASCII -Value "
127.0.0.1 the-cell-id-1-0.cell.service.cf.internal
127.0.0.1 the-cell-id-2-0.cell.service.cf.internal
127.0.0.1 the-cell-id-3-0.cell.service.cf.internal
127.0.0.1 the-cell-id-4-0.cell.service.cf.internal
"
ipconfig /flushdns
}

function Setup-TempDirContainerAccess() {
Write-Host "Setup-TempDirContainerAccess"
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users", "ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow")
$acl = Get-Acl "$env:TEMP"
$acl.AddAccessRule($rule)
Set-Acl "$env:TEMP" $acl
}

function Setup-GardenRunc() {
$env:GARDEN_BINPATH="$env:GARDEN_RUNC_RELEASE_PATH/bin"
$env:GROOTFS_BINPATH="$env:GARDEN_BINPATH"
$env:GROOTFS_STORE_PATH="$env:GROOT_IMAGE_STORE"

mkdir -Force "$env:GARDEN_BINPATH"
cp "$env:WINIT_BINARY" "$env:GARDEN_BINPATH/init.exe"
cp "$env:NSTAR_BINARY" "$env:GARDEN_BINPATH/nstar.exe"
cp "$env:GROOT_BINARY" "$env:GARDEN_BINPATH/grootfs.exe"
cp "$env:GROOT_QUOTA_DLL" "$env:GARDEN_BINPATH/quota.dll"
cp "$env:WINC_BINARY" "$env:GARDEN_BINPATH/winc.exe"
cp "$env:WINC_NETWORK_BINARY" "$env:GARDEN_BINPATH/winc-network.exe"
$tarPath = (Get-Command tar).Source
cp "${tarPath}" "${env:GARDEN_BINPATH}/tar.exe"
}

function Setup-Database() {
Write-Host "Setup-Database"

$origCaFile="$env:DIEGO_RELEASE_PATH\src\code.cloudfoundry.org\inigo\fixtures\certs\sql-certs\server-ca.crt"
$origCertFile="$env:DIEGO_RELEASE_PATH\src\code.cloudfoundry.org\inigo\fixtures\certs\sql-certs\server.crt"
$origKeyFile="$env:DIEGO_RELEASE_PATH\src\code.cloudfoundry.org\inigo\fixtures\certs\sql-certs\server.key"

$mysqlCertsDir = "$env:TEMP\mysql-certs" -replace '\\','\\'
mkdir -Force $mysqlCertsDir

$caFile="$mysqlCertsDir\\server-ca.crt"
$certFile="$mysqlCertsDir\\server.crt"
$keyFile="$mysqlCertsDir\\server.key"

cp $origCaFile $caFile
cp $origCertFile $certFile
cp $origKeyFile $keyFile

$mySqlBaseDir=(Get-ChildItem "C:\var\vcap\packages\mysql\mysql-*").FullName

Set-Content -Path "$mySqlBaseDir\my.ini" -Encoding Ascii -Value "[mysqld]
basedir=$mySqlBaseDir
datadir=C:\\var\\vcap\\data\\mysql
ssl-cert=$certFile
ssl-key=$keyFile
ssl-ca=$caFile
max_connections=1000"

Restart-Service Mysql
}

$timestamp="$((get-date).ToUniversalTime().ToString('yyyy-MM-ddTHH-mm-ss'))"
$logsDir="$env:TMP/inigo-logs-$timestamp"
echo "Log Dir: $logsDir"
mkdir -Force "$logsDir"

Setup-GardenRunc
Configure-Groot "$env:GARDEN_TEST_ROOTFS"
Configure-Winc-Network "delete"
Configure-Winc-Network "create"
Set-NetFirewallProfile -All -DefaultInboundAction Block -DefaultOutboundAction Allow -Enabled True
Setup-Database
Setup-DnsNames
Setup-TempDirContainerAccess

$env:CODE_CLOUDFOUNDRY_ORG_MODULE="$env:DIEGO_RELEASE_PATH/src/code.cloudfoundry.org"
$env:GUARDIAN_MODULE="$env:DIEGO_RELEASE_PATH/src/guardian"
$env:ROUTER_GOPATH="$env:ROUTING_RELEASE_PATH\src\code.cloudfoundry.org"
$env:ROUTING_API_GOPATH=$env:ROUTER_GOPATH
$env:APP_LIFECYCLE_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:AUCTIONEER_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:BBS_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:FILE_SERVER_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:HEALTHCHECK_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:LOCKET_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:REP_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:ROUTE_EMITTER_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:SSHD_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:SSH_PROXY_GOPATH=${env:CODE_CLOUDFOUNDRY_ORG_MODULE}
$env:GARDEN_GOPATH=${env:GUARDIAN_MODULE}

# used for routing to apps; same logic that Garden uses.
$ipAddressObject = Find-NetRoute -RemoteIPAddress "8.8.8.8" | Select-Object IpAddress
$ipAddress = $ipAddressObject.IpAddress
$env:EXTERNAL_ADDRESS="$ipAddress".Trim()

Invoke-Expression "go run github.com/onsi/ginkgo/v2/ginkgo $args --output-dir $logsDir --json-report report.json"
if ($LastExitCode -ne 0) {
throw "tests failed"
}
Loading