Skip to content

Commit 389d531

Browse files
committed
Rename virtsock_stress to sock_stress
A subsequent commit will add support for additional address families (TCP and TCP6 to start with) so sock_stress is more appropriate. Also rename the source files to more appropriate names. Signed-off-by: Rolf Neugebauer <[email protected]>
1 parent 7d4b3e5 commit 389d531

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

Dockerfile.linuxkit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM scratch
22
COPY ./c/build/* /usr/bin/
3-
COPY ./bin/virtsock_stress.linux /usr/bin/virtsock_stress
3+
COPY ./bin/sock_stress.linux /usr/bin/sock_stress

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.PHONY: build-in-container build-binaries virtsock_stress clean
2-
DEPS:=$(wildcard pkg/*.go) $(wildcard cmd/virtsock_stress/*.go) $(wildcard cmd/vsudd/*.go) Dockerfile.build Makefile
1+
.PHONY: build-in-container build-binaries sock_stress clean
2+
DEPS:=$(wildcard pkg/*.go) $(wildcard cmd/sock_stress/*.go) $(wildcard cmd/vsudd/*.go) Dockerfile.build Makefile
33

44
build-in-container: $(DEPS) clean
55
@echo "+ $@"
@@ -8,8 +8,8 @@ build-in-container: $(DEPS) clean
88
-v ${CURDIR}/bin:/go/src/github.com/linuxkit/virtsock/bin \
99
virtsock-build
1010

11-
build-binaries: vsudd virtsock_stress
12-
virtsock_stress: bin/virtsock_stress.darwin bin/virtsock_stress.linux bin/virtsock_stress.exe
11+
build-binaries: vsudd sock_stress
12+
sock_stress: bin/sock_stress.darwin bin/sock_stress.linux bin/sock_stress.exe
1313
vsudd: bin/vsudd.linux
1414

1515
bin/vsudd.linux: $(DEPS)
@@ -18,22 +18,22 @@ bin/vsudd.linux: $(DEPS)
1818
go build -o $@ -buildmode pie --ldflags '-s -w -extldflags "-static"' \
1919
cmd/vsudd/main.go cmd/vsudd/vsyslog.go
2020

21-
bin/virtsock_stress.linux: $(DEPS)
21+
bin/sock_stress.linux: $(DEPS)
2222
@echo "+ $@"
2323
GOOS=linux GOARCH=amd64 \
2424
go build -o $@ -buildmode pie --ldflags '-s -w -extldflags "-static"' \
25-
cmd/virtsock_stress/virtsock_stress.go cmd/virtsock_stress/common_hvsock.go cmd/virtsock_stress/common_vsock.go cmd/virtsock_stress/common_linux.go
25+
cmd/sock_stress/main.go cmd/sock_stress/hvsock.go cmd/sock_stress/vsock.go cmd/sock_stress/sock_linux.go
2626

27-
bin/virtsock_stress.darwin: $(DEPS)
27+
bin/sock_stress.darwin: $(DEPS)
2828
@echo "+ $@"
2929
GOOS=darwin GOARCH=amd64 \
3030
go build -o $@ --ldflags '-extldflags "-fno-PIC"' \
31-
cmd/virtsock_stress/virtsock_stress.go cmd/virtsock_stress/common_vsock.go cmd/virtsock_stress/common_darwin.go
31+
cmd/sock_stress/main.go cmd/sock_stress/vsock.go cmd/sock_stress/vsock_darwin.go
3232

33-
bin/virtsock_stress.exe: $(DEPS)
33+
bin/sock_stress.exe: $(DEPS)
3434
@echo "+ $@"
3535
GOOS=windows GOARCH=amd64 \
36-
go build -o $@ cmd/virtsock_stress/virtsock_stress.go cmd/virtsock_stress/common_hvsock.go cmd/virtsock_stress/common_windows.go
36+
go build -o $@ cmd/sock_stress/main.go cmd/sock_stress/hvsock.go cmd/sock_stress/hvsock_windows.go
3737

3838
# Target to build a bootable EFI ISO and kernel+initrd
3939
linuxkit: build-in-container Dockerfile.linuxkit hvtest.yml

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repository contains Go bindings and sample code for [Hyper-V sockets](https
55

66
- `pkg/hvsock`: Go binding for Hyper-V sockets
77
- `pkg/vsock`: Go binding for virtio VSOCK
8-
- `cmd/virtsock_stress`: A stress test program for virtsock
8+
- `cmd/sock_stress`: A stress test program for virtsock
99
- `cmd/vsudd`: A unix domain socket to virtsock proxy (used in Docker for Mac/Windows)
1010
- `scripts`: Miscellaneous scripts
1111
- `c`: Sample C code (including benchmarks and stress tests)
@@ -36,14 +36,14 @@ This should create a directory called `./hvtest-state`.
3636

3737
Run the server in the VM and client on the host:
3838
```
39-
linux$ virtsock_stress -s -v 1
40-
macos$ ./bin/virtsock_stress.darwin -c 3 -m hyperkit:./hvtest-state -v 1
39+
linux$ sock_stress -s -v 1
40+
macos$ ./bin/sock_stress.darwin -c 3 -m hyperkit:./hvtest-state -v 1
4141
```
4242

4343
Run the server on the host and the client inside the VM:
4444
```
45-
macos$ ./bin/virtsock_stress.darwin -s -m hyperkit:./hvtest-state -v 1
46-
linux$ virtsock_stress -c 2 -v 1
45+
macos$ ./bin/sock_stress.darwin -s -m hyperkit:./hvtest-state -v 1
46+
linux$ sock_stress -c 2 -v 1
4747
```
4848

4949
### Windows

cmd/virtsock_stress/README.md renamed to cmd/sock_stress/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ container:
1414
$ cat >Dockerfile <<EOF
1515
FROM alpine
1616
RUN apk update && apk add strace
17-
ADD virtsock_stress.linux /virtsock_stress
18-
ENTRYPOINT ["/virtsock_stress"]
17+
ADD sock_stress.linux /sock_stress
18+
ENTRYPOINT ["/sock_stress"]
1919
EOF
2020
$ docker build -t stress . && docker run -it --rm --net=host --privileged stress [...options...]
2121

@@ -28,7 +28,7 @@ themselves differ).
2828
To run against standalone Hyperkit the path to the sockets must be
2929
specified when starting Hyperkit and must be passed to the option:
3030

31-
macos$ ./virtsock_stress.darwin -s -m hyperkit:/var/run/
31+
macos$ ./sock_stress.darwin -s -m hyperkit:/var/run/
3232

3333
(this assumes hyperkit was built without `PRI_ADDR_PREFIX` or
3434
`CONNECT_SOCKET_NAME` set at build time and run with e.g. `-s
@@ -37,7 +37,7 @@ specified when starting Hyperkit and must be passed to the option:
3737
In Docker mode everything is implied to be as it is configured by
3838
Docker for Mac. This is the default but can be given explicitly with:
3939

40-
macos$ ./virtsock_stress.darwin -s -m docker
40+
macos$ ./sock_stress.darwin -s -m docker
4141

4242
# Specific OS Pairs
4343

@@ -50,7 +50,7 @@ Start the linux container with program in server mode:
5050
The start the client in a separate powershell window:
5151

5252
PS> $vmId = (Get-VM MobyLinuxVM).Id
53-
PS> .\virtsock_stress.exe -c $vmId
53+
PS> .\sock_stress.exe -c $vmId
5454

5555

5656
## Linux & Docker for Mac
@@ -59,10 +59,10 @@ When running as a client on the Linux side the correct address is cid
5959
"2" (the host):
6060

6161
linux$ docker run -it --rm --net=host --privileged stress -c 2
62-
macos$ ./virtsock_stress.darwin -s
62+
macos$ ./sock_stress.darwin -s
6363

6464
When running as a client on the MacOS side the correct address is cid
6565
is "3" (the guest, as configued by Docker for Mac):
6666

6767
linux$ docker run -it --rm --net=host --privileged stress -s
68-
macos$ ./virtsock_stress.darwin -c 3
68+
macos$ ./sock_stress.darwin -c 3
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)