User:Tampakrap/puppet

From Gentoo Wiki
Jump to: navigation, search

puppet-portage

package_use

test case 1

Reproducer:
1)

 package_use { "app-misc/dummy":
   use => "X",
 }

2) Run agent

Results:

  1. Create a file /etc/portage/package.use/default (PASSED)
  2. Content is app-misc/dummy X (PASSED)

test case 2

Reproducer:
1)

 package_use { "app-misc/dummy":
   use => ["X", "-doc"],
 }

2) Run agent
3)

 package_use { "app-misc/dummy":
   use    => ["X", "-doc"],
 }

4) Run agent

Results:

  1. Create a file /etc/portage/package.use/dummy (PASSED)
  2. Content is app-misc/dummy X -doc (PASSED)
  3. Remove /etc/portage/package.use/default (FAILED)

test case 3

Reproducer:
1)

 package_use { "app-misc/dummy":
   use    => ["-X", "doc"],
   target => "dummy",
 }

2) Run agent

Results:

  1. Update the content of /etc/portage/package.use/dummy to -X doc (PASSED)

test case 4

Reproducer:
1)

 package_use { "app-misc/dummy":
   use    => "X doc",
   target => "dummy",
 }

2) Run agent

  1. Fail because of the whitespace (PASSED)

test case 5

Reproducer:
1)

 package_use { "app-misc/dummy":
   use    => ["X", "doc"],
   target => "dummy",
 }
 package_use { "sys-process/htop":
   use    => "unicode",
   target => "dummy",
 }

2) Run agent

Results:

  1. Append to package.use/dummy the content sys-process/htop unicode (PASSED)

test case 6

Reproducer:
1)

 package_use { "sys-process/htop":
   use    => "unicode",
   target => "dummy",
 }
 package_use { "app-misc/dummy":
   use    => ["X", "doc"],
   target => "dummy",
 }

2) Run agent
3)

 package_use { "app-misc/dummy":
   use    => ["X", "doc"],
   target => "dummy",
 }

4) Run agent

Results:

  1. package.use/dummy does not have htop entry (FAILED)

test case 7

Reproducer:
1)

 package_use { "sys-process/htop":
   use    => "unicode",
   target => "dummy",
 }
 package_use { "app-misc/dummy":
   use    => ["X", "doc"],
   target => "dummy",
 }

2) Run agent
3)

 package_use { "sys-process/htop":
   use    => "unicode",
   target => "dummy",
 }
 package_use { "app-misc/dummy":
   use    => ["X", "doc"],
   target => "dummy_new",
 }

4) Run agent

Results:

  1. Create package.use/dummy_new with content app-misc/dummy X doc (PASSED)
  2. Remove the app-misc/dummy entry from package.use/dummy (FAILED)
  3. package.use/dummy still has the sys-process/htop entry (PASSED)

test case 8

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "=3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content =app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X disabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X disabled

test case 9

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => ">=3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content >=app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X enabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X enabled

test case 10

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "<=3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content <=app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X disabled
  5. emerge =app-misc/dummy-1 has X enabled
  6. emerge =app-misc/dummy-4 has X disabled

test case 11

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => ">3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content >app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X disabled
  4. emerge =app-misc/dummy-3-r1 has X enabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X enabled

test case 12

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "<3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content <app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X disabled
  4. emerge =app-misc/dummy-3-r1 has X disabled
  5. emerge =app-misc/dummy-1 has X enabled
  6. emerge =app-misc/dummy-4 has X disabled

test case 13

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "~3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content ~app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X enabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X disabled

test case 14

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "3",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content =app-misc/dummy-3 X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X disabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X disabled

test case 15

Reproducer:
1)

 package_use { "app-misc/dummy":
   use     => "doc",
   target  => "dummy",
   version => "=3*",
 }

2) Run agent

Results:

  1. (assuming X useflag is disabled globally)
  2. Create package.use/dummy with content =app-misc/dummy-3* X
  3. emerge =app-misc/dummy-3 has X enabled
  4. emerge =app-misc/dummy-3-r1 has X enabled
  5. emerge =app-misc/dummy-1 has X disabled
  6. emerge =app-misc/dummy-4 has X disabled

package_keywords

package_mask

package_unmask

portage::package

make.conf

facts

rspec/tests