diff --git a/providers/alternatives.rb b/providers/alternatives.rb index df3cf1bd..08076a74 100644 --- a/providers/alternatives.rb +++ b/providers/alternatives.rb @@ -38,6 +38,7 @@ description = "Add alternative for #{cmd}" converge_by(description) do Chef::Log.debug "Adding alternative for #{cmd}" + shell_out("rm /var/lib/alternatives/#{cmd}") install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}") unless install_cmd.exitstatus == 0 Chef::Application.fatal!(%Q[ set alternative failed ]) diff --git a/test/integration/openjdk-7/bats/verify_openjdk-7.bats b/test/integration/openjdk-7/bats/verify_openjdk-7.bats index 92e1c219..dcba2d1f 100644 --- a/test/integration/openjdk-7/bats/verify_openjdk-7.bats +++ b/test/integration/openjdk-7/bats/verify_openjdk-7.bats @@ -7,3 +7,8 @@ run test -d $JAVA_HOME [ "$status" -eq 0 ] } + +@test "properly links jar" { + run test -L /usr/bin/jar + [ "$status" -eq 0 ] +} diff --git a/test/integration/openjdk/bats/verify_openjdk.bats b/test/integration/openjdk/bats/verify_openjdk.bats index 32432388..a617a032 100644 --- a/test/integration/openjdk/bats/verify_openjdk.bats +++ b/test/integration/openjdk/bats/verify_openjdk.bats @@ -7,3 +7,8 @@ run test -d $JAVA_HOME [ "$status" -eq 0 ] } + +@test "properly links jar" { + run test -L /usr/bin/jar + [ "$status" -eq 0 ] +} diff --git a/test/integration/oracle-7/bats/verify_oracle-7.bats b/test/integration/oracle-7/bats/verify_oracle-7.bats index 92e1c219..dcba2d1f 100644 --- a/test/integration/oracle-7/bats/verify_oracle-7.bats +++ b/test/integration/oracle-7/bats/verify_oracle-7.bats @@ -7,3 +7,8 @@ run test -d $JAVA_HOME [ "$status" -eq 0 ] } + +@test "properly links jar" { + run test -L /usr/bin/jar + [ "$status" -eq 0 ] +} diff --git a/test/integration/oracle/bats/verify_oracle.bats b/test/integration/oracle/bats/verify_oracle.bats index 32432388..a617a032 100644 --- a/test/integration/oracle/bats/verify_oracle.bats +++ b/test/integration/oracle/bats/verify_oracle.bats @@ -7,3 +7,8 @@ run test -d $JAVA_HOME [ "$status" -eq 0 ] } + +@test "properly links jar" { + run test -L /usr/bin/jar + [ "$status" -eq 0 ] +}