Skip to content

Commit 0bfe57a

Browse files
committed
Ability to running test via vagrant-libvirt and fix can not run test via 'sudo make test'
1 parent f717cb8 commit 0bfe57a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vagrant/
2+
/containerd-driver

Diff for: README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ You can also read more about `network stanza` in the [`nomad official documentat
239239

240240
Nomad schedules workloads of various types across a cluster of generic hosts. Because of this, placement is not known in advance and you will need to use service discovery to connect tasks to other services deployed across your cluster. Nomad integrates with Consul to provide service discovery and monitoring.
241241

242-
A [`service`](https://www.nomadproject.io/docs/job-specification/service) stanza can be added to your job spec, to enable service discovery.
242+
A [`service`](https://www.nomadproject.io/docs/job-specification/service) stanza can be added to your job spec, to enable service discovery.
243243

244244
The service stanza instructs Nomad to register a service with Consul.
245245

@@ -256,10 +256,17 @@ $ sudo make test
256256
It is highly recommended to run these tests either as part of a CI/CD system e.g. circleci or on
257257
a immutable infrastructure e.g vagrant VMs.
258258

259+
You can also run an individual test by specifying the test name. e.g.
260+
261+
```
262+
$ cd tests
263+
$ sudo ./run_tests.sh 001-test-redis.sh
264+
```
265+
259266
## Cleanup
260267
```
261268
make clean
262-
```
269+
```
263270
This will delete your binary: `containerd-driver`
264271

265272
```

Diff for: Vagrantfile

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ VAGRANTFILE_API_VERSION = "2"
66
Vagrant.configure("2") do |config|
77
config.vm.define "containerd-linux"
88
config.vm.box = "hashicorp/bionic64"
9+
config.vm.provider "libvirt" do |v, override|
10+
override.vm.box = "generic/debian10"
11+
override.vm.synced_folder ".", "/home/vagrant/go/src/github.com/Roblox/nomad-driver-containerd", type: "nfs", nfs_version: 4, nfs_udp: false
12+
end
913
config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/Roblox/nomad-driver-containerd"
1014
config.ssh.extra_args = ["-t", "cd /home/vagrant/go/src/github.com/Roblox/nomad-driver-containerd; bash --login"]
1115
config.vm.network "forwarded_port", guest: 4646, host: 4646, host_ip: "127.0.0.1"
@@ -20,6 +24,8 @@ Vagrant.configure("2") do |config|
2024
echo "export GOPATH=/home/vagrant/go" >> /home/vagrant/.bashrc
2125
echo "export PATH=$PATH:/usr/local/go/bin" >> /home/vagrant/.bashrc
2226
source /home/vagrant/.bashrc
27+
# without keeping HOME env, 'sudo make test' will try to find files under /root/go/
28+
echo "Defaults env_keep += HOME" | sudo tee /etc/sudoers.d/keep_home
2329
2430
# Install golang-1.14.3
2531
if [ ! -f "/usr/local/go/bin/go" ]; then

0 commit comments

Comments
 (0)