Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemontero committed May 3, 2016
1 parent 5b83447 commit dfdde46
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 21 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/extended/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function os::test::extended::setup {
sudo chcon -t svirt_sandbox_file_t ${VOLUME_DIR}
fi

#GGM add disable-selinux call and getenforce call to verify here
sudo yum install -y quota

configure_os_server

Expand Down
64 changes: 47 additions & 17 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package util

import (
"bufio"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -74,12 +75,41 @@ func ExamineDiskUsage() {
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on getenforce %v\n\n", err)
}
out, err = exec.Command("/usr/bin/quota", "-v", "-A").Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n quota -v -A output: %s\n\n", string(out))
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on quota -v -A %v\n\n", err)
}
out, err = exec.Command("/bin/docker", "info").Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n docker info output: %s\n\n", string(out))
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on docker info %v\n\n", err)
}
out, err = exec.Command("/bin/docker", "ps", "-a").Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n docker ps -a output: %s\n\n", string(out))
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on docker ps %v\n\n", err)
}
out, err = exec.Command("/bin/docker", "ps", "-a", "-q").Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n docker ps output: %s\n\n", string(out))
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on docker ps %v\n\n", err)
}
scanner := bufio.NewScanner(strings.NewReader(string(out)))
for scanner.Scan() {
containerID := scanner.Text()
fmt.Fprintf(g.GinkgoWriter, "\n\n running docker inspect on %s \n\n", containerID)
out, err = exec.Command("/bin/docker", "inspect", containerID).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n docker inspect output: %s\n\n", string(out))
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on docker inspect %v\n\n", err)
}
}
}

// ExaminePodDiskUsage will dump df/du output on registry pod; leveraging this as part of diagnosing
Expand All @@ -106,11 +136,11 @@ func ExaminePodDiskUsage(oc *CLI) {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on get pods: %v\n\n", err)
}

out, err = oc.Run("get").Args("pods", "-n", "default", "--config", KubeConfigPath()).Output()
out, err = oc.Run("get").Args("pods", podName, "-o", "json", "-n", "default", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n pods compact list: \n%s\n\n", out)
fmt.Fprintf(g.GinkgoWriter, "\n\n registry pod json: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on get pods : %v\n", err)
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on get registry pod json : %v\n", err)
}

out, err = oc.Run("exec").Args("-n", "default", podName, "df", "--config", KubeConfigPath()).Output()
Expand All @@ -119,12 +149,6 @@ func ExaminePodDiskUsage(oc *CLI) {
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod df: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "df", "-i", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n df from registry pod: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod df: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "du", "/registry", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n du from registry pod: \n%s\n\n", out)
Expand All @@ -133,23 +157,29 @@ func ExaminePodDiskUsage(oc *CLI) {
}
out, err = oc.Run("exec").Args("-n", "default", podName, "rmdir", "/registry/docker/registry/v2/repositories/ggm", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n mkdir from registry pod: \n%s\n\n", out)
fmt.Fprintf(g.GinkgoWriter, "\n\n rmdir 1 from registry pod: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod mkdir: %v\n", err)
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod rmdir 1: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "mkdir", "/registry/docker/registry/v2/repositories/ggm", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n mkdir from registry pod: \n%s\n\n", out)
fmt.Fprintf(g.GinkgoWriter, "\n\n mkdir 1 from registry pod: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod mkdir: %v\n", err)
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod mkdir 1: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "/usr/bin/quota", "--config", KubeConfigPath()).Output()
out, err = oc.Run("exec").Args("-n", "default", podName, "rmdir", "/registry/ggm", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n quota from registry pod: \n%s\n\n", out)
fmt.Fprintf(g.GinkgoWriter, "\n\n rmdir 2 from registry pod: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod quota: %v\n", err)
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod rmdir 2: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "mkdir", "/registry/ggm", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n mkdir 2 from registry pod: \n%s\n\n", out)
} else {
fmt.Fprintf(g.GinkgoWriter, "\n\n got error on reg pod mkdir 2: %v\n", err)
}
out, err = oc.Run("exec").Args("-n", "default", podName, "/usr/sbin/quotaoff", "-av", "--config", KubeConfigPath()).Output()
out, err = oc.Run("exec").Args("-n", "default", podName, "/usr/bin/quota", "--config", KubeConfigPath()).Output()
if err == nil {
fmt.Fprintf(g.GinkgoWriter, "\n\n quota from registry pod: \n%s\n\n", out)
} else {
Expand Down

0 comments on commit dfdde46

Please sign in to comment.